Commit 13291867 authored by Cristian Greco's avatar Cristian Greco

Imported Upstream version 2.6.5

parent 422b8509
......@@ -89,7 +89,7 @@ Translations authors:
- Italian: Matteo Sechi (bu17714@gmail.com)
- Japanese: Nardog (alphisation@gmail.com)
- Korean: Jin Woo Sin (jin828sin@users.sourceforge.net)
- Norwegian: Lars-Erik Labori (hamil@users.sourceforge.net)
- Norwegian: Tomaso
- Polish: Mariusz Fik (fisiu@opensuse.org)
- Portuguese: Nick Marinho (nickmarinho@gmail.com)
- Romanian: Obada Denis (obadadenis@users.sourceforge.net)
......
* Thu Feb 3 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.6.5
- BUGFIX: Make sure the progress is not 100% unless the file is complete
- BUGFIX: Fix memory leak in HTTP torrent downloader
- BUGFIX: Use native file dialogs (by Vladimir Golovnev)
- BUGFIX: Fix encoding problem in torrent moving code (by Vladimir Golovnev)
- BUGFIX: Performance improvement on ARM
- BUGFIX: RSS code rewrite (more cpu/memory efficient)
- I18N: Updated Norwegian translation (Tomaso)
* Sun Jan 23 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.6.4
- BUGFIX: Added unicode support to email notification
- BUGFIX: Improved compatibility with various SMTP servers
......
[Desktop Entry]
Categories=Qt;Network;P2P;
Comment=V2.6.4
Comment=V2.6.5
Exec=qbittorrent %f
GenericName=Bittorrent client
GenericName[ar]=العميل Bittorrent
......
......@@ -47,7 +47,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleGetInfoString</key>
<string>2.6.4</string>
<string>2.6.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>
......
......@@ -78,7 +78,7 @@ class about : public QDialog, private Ui::AboutDlg{
<li><u>Italian:</u> Matteo Sechi (bu17714@gmail.com)</li>\
<li><u>Japanese:</u> Nardog (alphisation@gmail.com)</li>\
<li><u>Korean:</u> Jin Woo Sin (jin828sin@users.sourceforge.net)</li>\
<li><u>Norwegian:</u> Lars-Erik Labori (hamil@users.sourceforge.net)</li>\
<li><u>Norwegian:</u> Tomaso</li>\
<li><u>Polish:</u> Mariusz Fik (fisiu@opensuse.org)</li>\
<li><u>Portuguese:</u> Nick Marinho (nickmarinho@gmail.com)</li>\
<li><u>Romanian:</u> Obada Denis (obadadenis@users.sourceforge.net)</li>\
......
......@@ -38,7 +38,7 @@
#include "downloadthread.h"
#include "preferences.h"
#ifndef DISABLE_GUI
#include "rsssettings.h"
#include "rsssettings.h"
#endif
#include "qinisettings.h"
......@@ -54,48 +54,46 @@ downloadThread::downloadThread(QObject* parent) : QObject(parent) {
void downloadThread::processDlFinished(QNetworkReply* reply) {
QString url = reply->url().toString();
qDebug("Download finished: %s", qPrintable(url));
// Check if the request was successful
if(reply->error() != QNetworkReply::NoError) {
// Failure
qDebug("Download failure (%s), reason: %s", qPrintable(url), qPrintable(errorCodeToString(reply->error())));
emit downloadFailure(url, errorCodeToString(reply->error()));
} else {
QVariant redirection = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
if(redirection.isValid()) {
// We should redirect
qDebug("Redirecting from %s to %s", qPrintable(url), qPrintable(redirection.toUrl().toString()));
m_redirectMapping.insert(redirection.toUrl().toString(), url);
downloadUrl(redirection.toUrl().toString());
return;
}
// Checking if it was redirecting, restoring initial URL
if(m_redirectMapping.contains(url)) {
url = m_redirectMapping.take(url);
}
// Success
QString filePath;
QTemporaryFile *tmpfile = new QTemporaryFile;
tmpfile->setAutoRemove(false);
if (tmpfile->open()) {
filePath = tmpfile->fileName();
qDebug("Temporary filename is: %s", qPrintable(filePath));
if(reply->open(QIODevice::ReadOnly)) {
// TODO: Support GZIP compression
tmpfile->write(reply->readAll());
reply->close();
tmpfile->close();
delete tmpfile;
// Send finished signal
emit downloadFinished(url, filePath);
} else {
// Error when reading the request
tmpfile->close();
delete tmpfile;
emit downloadFailure(url, tr("I/O Error"));
}
reply->deleteLater();
return;
}
// Check if the server ask us to redirect somewhere lese
const QVariant redirection = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
if(redirection.isValid()) {
// We should redirect
qDebug("Redirecting from %s to %s", qPrintable(url), qPrintable(redirection.toUrl().toString()));
m_redirectMapping.insert(redirection.toUrl().toString(), url);
downloadUrl(redirection.toUrl().toString());
reply->deleteLater();
return;
}
// Checking if it was redirected, restoring initial URL
if(m_redirectMapping.contains(url)) {
url = m_redirectMapping.take(url);
}
// Success
QTemporaryFile tmpfile;
tmpfile.setAutoRemove(false);
if (tmpfile.open()) {
QString filePath = tmpfile.fileName();
qDebug("Temporary filename is: %s", qPrintable(filePath));
if(reply->isOpen() || reply->open(QIODevice::ReadOnly)) {
// TODO: Support GZIP compression
tmpfile.write(reply->readAll());
tmpfile.close();
// Send finished signal
emit downloadFinished(url, filePath);
} else {
delete tmpfile;
// Error when reading the request
emit downloadFailure(url, tr("I/O Error"));
}
} else {
emit downloadFailure(url, tr("I/O Error"));
}
// Clean up
reply->deleteLater();
......@@ -119,24 +117,18 @@ void downloadThread::loadCookies(const QString &host_name, QString url) {
}
#endif
void downloadThread::downloadTorrentUrl(QString url) {
#ifndef DISABLE_GUI
// Load cookies
QString host_name = QUrl::fromEncoded(url.toLocal8Bit()).host();
if(!host_name.isEmpty())
loadCookies(host_name, url);
#endif
void downloadThread::downloadTorrentUrl(const QString &url) {
// Process request
QNetworkReply *reply = downloadUrl(url);
connect(reply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(checkDownloadSize(qint64,qint64)));
}
QNetworkReply* downloadThread::downloadUrl(QString url){
QNetworkReply* downloadThread::downloadUrl(const QString &url){
// Update proxy settings
applyProxySettings();
#ifndef DISABLE_GUI
// Load cookies
QString host_name = QUrl::fromEncoded(url.toLocal8Bit()).host();
QString host_name = QUrl::fromEncoded(url.toUtf8()).host();
if(!host_name.isEmpty())
loadCookies(host_name, url);
#endif
......@@ -157,20 +149,22 @@ QNetworkReply* downloadThread::downloadUrl(QString url){
}
void downloadThread::checkDownloadSize(qint64 bytesReceived, qint64 bytesTotal) {
QNetworkReply *reply = qobject_cast<QNetworkReply*>(sender());
if(!reply) return;
if(bytesTotal > 0) {
QNetworkReply *reply = static_cast<QNetworkReply*>(sender());
// Total number of bytes is available
if(bytesTotal > 1048576) {
// More than 1MB, this is probably not a torrent file, aborting...
reply->abort();
reply->deleteLater();
} else {
disconnect(reply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(checkDownloadSize(qint64,qint64)));
}
} else {
if(bytesReceived > 1048576) {
// More than 1MB, this is probably not a torrent file, aborting...
QNetworkReply *reply = static_cast<QNetworkReply*>(sender());
reply->abort();
reply->deleteLater();
}
}
}
......@@ -253,7 +247,7 @@ QString downloadThread::errorCodeToString(QNetworkReply::NetworkError status) {
}
#ifndef QT_NO_OPENSSL
void downloadThread::ignoreSslErrors(QNetworkReply* reply,QList<QSslError> errors) {
void downloadThread::ignoreSslErrors(QNetworkReply* reply, const QList<QSslError> &errors) {
Q_UNUSED(errors)
// Ignore all SSL errors
reply->ignoreSslErrors();
......
......@@ -43,19 +43,19 @@ class downloadThread : public QObject {
public:
downloadThread(QObject* parent = 0);
QNetworkReply* downloadUrl(QString url);
void downloadTorrentUrl(QString url);
QNetworkReply* downloadUrl(const QString &url);
void downloadTorrentUrl(const QString &url);
//void setProxy(QString IP, int port, QString username, QString password);
signals:
void downloadFinished(QString url, QString file_path);
void downloadFailure(QString url, QString reason);
void downloadFinished(const QString &url, const QString &file_path);
void downloadFailure(const QString &url, const QString &reason);
private slots:
void processDlFinished(QNetworkReply* reply);
void checkDownloadSize(qint64 bytesReceived, qint64 bytesTotal);
#ifndef QT_NO_OPENSSL
void ignoreSslErrors(QNetworkReply*,QList<QSslError>);
void ignoreSslErrors(QNetworkReply*,const QList<QSslError>&);
#endif
private:
......
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
......@@ -518,7 +518,7 @@ QString misc::cacheLocation() {
// use Binary prefix standards from IEC 60027-2
// see http://en.wikipedia.org/wiki/Kilobyte
// value must be given in bytes
QString misc::friendlyUnit(double val) {
QString misc::friendlyUnit(qreal val) {
if(val < 0)
return tr("Unknown", "Unknown (size)");
int i = 0;
......
......@@ -153,7 +153,7 @@ public:
// use Binary prefix standards from IEC 60027-2
// see http://en.wikipedia.org/wiki/Kilobyte
// value must be given in bytes
static QString friendlyUnit(double val);
static QString friendlyUnit(qreal val);
static bool isPreviewable(QString extension);
static QString branchPath(QString file_path, bool uses_slashes=false);
static QString fileName(QString file_path);
......
......@@ -467,7 +467,7 @@ void options_imp::setStyle(QString style) {
void options_imp::loadOptions(){
int intValue;
float floatValue;
qreal floatValue;
QString strValue;
// General preferences
const Preferences pref;
......@@ -754,7 +754,7 @@ int options_imp::getDHTPort() const {
}
// Return Share ratio
float options_imp::getMaxRatio() const{
qreal options_imp::getMaxRatio() const{
if(checkMaxRatio->isChecked()){
return spinMaxRatio->value();
}
......
......@@ -129,7 +129,7 @@ private:
int getDHTPort() const;
bool isLSDEnabled() const;
int getEncryptionSetting() const;
float getMaxRatio() const;
qreal getMaxRatio() const;
// Proxy options
bool isProxyEnabled() const;
bool isProxyAuthEnabled() const;
......
......@@ -546,11 +546,11 @@ public:
setValue(QString::fromUtf8("Preferences/Bittorrent/Encryption"), val);
}
float getMaxRatio() const {
qreal getMaxRatio() const {
return value(QString::fromUtf8("Preferences/Bittorrent/MaxRatio"), -1).toDouble();
}
void setMaxRatio(float ratio) {
void setMaxRatio(qreal ratio) {
setValue(QString::fromUtf8("Preferences/Bittorrent/MaxRatio"), ratio);
}
......
......@@ -59,7 +59,7 @@ class PreviewListDelegate: public QItemDelegate {
QItemDelegate::drawDisplay(painter, opt, option.rect, misc::friendlyUnit(index.data().toLongLong()));
break;
case PreviewSelect::PROGRESS:{
float progress = index.data().toDouble()*100.;
qreal progress = index.data().toDouble()*100.;
QStyleOptionProgressBarV2 newopt;
newopt.rect = opt.rect;
newopt.text = QString(QByteArray::number(progress, 'f', 1))+QString::fromUtf8("%");
......
......@@ -57,14 +57,14 @@ public:
case DOWN_SPEED:
case UP_SPEED:{
QItemDelegate::drawBackground(painter, opt, index);
double speed = index.data().toDouble();
qreal speed = index.data().toDouble();
if (speed > 0.0)
QItemDelegate::drawDisplay(painter, opt, opt.rect, misc::friendlyUnit(speed)+tr("/s", "/second (i.e. per second)"));
break;
}
case PROGRESS:{
QItemDelegate::drawBackground(painter, opt, index);
double progress = index.data().toDouble();
qreal progress = index.data().toDouble();
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString::number(progress*100., 'f', 1)+"%");
break;
}
......
......@@ -53,7 +53,7 @@ public:
}
void setAvailability(const std::vector<int>& avail) {
double average = 0;
qreal average = 0;
if(avail.empty()) {
// Empty bar
QPixmap pix = QPixmap(1, 1);
......@@ -114,10 +114,10 @@ protected:
painter.drawPixmap(rect(), pixmap);
}
QColor getPieceColor(int avail, double average) {
QColor getPieceColor(int avail, qreal average) {
if(!avail) return Qt::white;
//qDebug("avail: %d/%d", avail, max_avail);
double fraction = 100.*average/avail;
qreal fraction = 100.*average/avail;
if(fraction < 100)
fraction *= 0.8;
else
......
This diff is collapsed.
......@@ -75,8 +75,12 @@ public:
break;
case PROGRESS:{
QStyleOptionProgressBarV2 newopt;
float progress = index.data().toDouble()*100.;
qreal progress = index.data().toDouble()*100.;
newopt.rect = opt.rect;
// We don't want to display 100% unless
// the torrent is really complete
if(progress > 99.94 && progress < 100.)
progress = 99.9;
newopt.text = QString(QByteArray::number(progress, 'f', 1))+QString::fromUtf8("%");
newopt.progress = (int)progress;
newopt.maximum = 100;
......
This diff is collapsed.
......@@ -76,11 +76,11 @@ public:
QTorrentHandle getTorrentHandle(QString hash) const;
std::vector<libtorrent::torrent_handle> getTorrents() const;
bool isFilePreviewPossible(QString fileHash) const;
float getPayloadDownloadRate() const;
float getPayloadUploadRate() const;
qreal getPayloadDownloadRate() const;
qreal getPayloadUploadRate() const;
libtorrent::session_status getSessionStatus() const;
int getListenPort() const;
float getRealRatio(QString hash) const;
qreal getRealRatio(QString hash) const;
QHash<QString, TrackerInfos> getTrackersInfo(QString hash) const;
bool hasActiveTorrents() const;
bool hasDownloadingTorrents() const;
......@@ -129,7 +129,7 @@ public slots:
void setMaxUploadsPerTorrent(int max);
void setDownloadRateLimit(long rate);
void setUploadRateLimit(long rate);
void setMaxRatio(float ratio);
void setMaxRatio(qreal ratio);
void setDHTPort(int dht_port);
void setProxySettings(const libtorrent::proxy_settings &proxySettings);
void setSessionSettings(const libtorrent::session_settings &sessionSettings);
......@@ -224,7 +224,7 @@ private:
// Ratio
QPointer<QTimer> BigRatioTimer;
// HTTP
QPointer<downloadThread> downloader;
downloadThread* downloader;
// File System
ScanFoldersModel *m_scanFolders;
// Console / Log
......@@ -233,7 +233,7 @@ private:
// Settings
bool preAllocateAll;
bool addInPause;
float ratio_limit;
qreal ratio_limit;
int high_ratio_action;
bool UPnPEnabled;
bool LSDEnabled;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -25,6 +25,7 @@ SOURCES += $$PWD/rss_imp.cpp \
$$PWD/rssdownloadrule.cpp \
$$PWD/rssdownloadrulelist.cpp \
$$PWD/cookiesdlg.cpp \
rss/rssfile.cpp
FORMS += $$PWD/rss.ui \
$$PWD/rsssettingsdlg.ui \
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment