1
mirror of https://github.com/qbittorrent/qBittorrent synced 2025-10-07 09:52:18 +02:00

Compare commits

...

78 Commits

Author SHA1 Message Date
Christophe Dumez
b46d8934ed Fix escaping in VERSION 2010-03-04 11:19:50 +00:00
Christophe Dumez
493b537215 tagged v2.1.6 release 2010-03-04 08:55:18 +00:00
Christophe Dumez
fae08f7014 Bump to v2.1.6 2010-03-04 08:45:36 +00:00
Christophe Dumez
31d65ddf77 Fix headless compilation 2010-03-04 08:36:35 +00:00
Christophe Dumez
4cd9cfdb59 BUGFIX: Command-line parameters are no longer required to be in UTF-8 2010-03-04 08:34:45 +00:00
Christophe Dumez
8d55368f6a BUGFIX: Only one log window can be opened at a time 2010-03-04 08:23:16 +00:00
Christophe Dumez
2a07fc0dea Fix memory leak in RSS 2010-03-04 08:14:21 +00:00
Christophe Dumez
be6099a797 BUGFIX: Fix ratio calculation for directly seeded torrents (Thanks phorane) 2010-02-17 08:13:47 +00:00
Christophe Dumez
b131b139f7 Fix save path display in properties 2010-02-14 15:24:54 +00:00
Christophe Dumez
c40455dbbf Revert useless 64bit patch 2010-02-10 23:22:33 +00:00
Christophe Dumez
75f0d86710 Added LIBS += -L/usr/lib64 for 64bit 2010-02-10 22:28:47 +00:00
Christophe Dumez
33447bf9fb Update release date 2010-02-10 21:34:13 +00:00
Christophe Dumez
a9365bc126 - Fix possible race condition in search engine 2010-02-10 21:21:43 +00:00
Christophe Dumez
f54b65a56d Add back CONFIG += link_pkgconfig or it causes crashes 2010-02-10 21:14:11 +00:00
Christophe Dumez
f9abbea1cc - Update helper version 2010-02-10 20:15:55 +00:00
Christophe Dumez
c267f6911d BUGFIX: Improved HTTP gzip compression detection in downloader 2010-02-10 20:07:00 +00:00
Christophe Dumez
dd51d39f5b BUGFIX: Only one program preferences dialog is allowed at a time 2010-02-09 23:36:03 +00:00
Christophe Dumez
a3e90e1c05 Fix memory leak in RSS 2010-02-09 21:22:09 +00:00
Christophe Dumez
6bd1d2551b - Bump to v2.1.5 2010-02-09 20:53:50 +00:00
Christophe Dumez
cf0c359abf BUGFIX: Fix actions on selected torrents (non-selected torrents could be affected) 2010-02-09 20:48:48 +00:00
Christophe Dumez
461cca2f52 Link against boost and ssl to fix issues with gold linker 2010-02-09 12:05:39 +00:00
Christophe Dumez
1ee45151a1 - Bump to v2.1.4 2010-02-08 19:10:13 +00:00
Christophe Dumez
772f05c5d4 - Updated language files 2010-02-08 19:06:45 +00:00
Christophe Dumez
de9e215404 BUGFIX: Fix file prioritizing in a torrent 2010-02-08 18:52:43 +00:00
Christophe Dumez
eeabf85e3b BUGFIX: Fix possible crash when changing torrents label 2010-02-07 18:39:37 +00:00
Christophe Dumez
6b99c84fe3 BUGFIX: Fix possible crash when deleting a torrent 2010-02-06 21:34:26 +00:00
Christophe Dumez
7d42969505 Fix font size of two torrent addition dialog buttons (Patch by Mariusz Fik) 2010-02-05 19:11:44 +00:00
Christophe Dumez
90351c4a57 BUGFIX: Usage display was improved and localized (--help) 2010-02-05 19:06:46 +00:00
Christophe Dumez
492b9dc88f BUGFIX: Make sure seeding torrents display a progress of 100% 2010-02-04 20:32:42 +00:00
Christophe Dumez
c9a8c1d053 - Fixes to German translation 2010-02-03 07:59:45 +00:00
Christophe Dumez
c8fdf8dc10 - Updated Ukranian translation 2010-02-02 20:25:09 +00:00
Christophe Dumez
119f83fbf0 - Bump to v2.1.3 2010-01-31 19:30:13 +00:00
Christophe Dumez
e8db20a558 BUGFIX: Clear torrent error state when resuming it 2010-01-31 19:07:17 +00:00
Christophe Dumez
508a811a8a BUGFIX: Fix Scan directory preferences in Web UI 2010-01-31 13:50:18 +00:00
Christophe Dumez
296267ec20 BUGFIX: Fix crash when double-clicking on a torrent that has no metadata to open
its save path
2010-01-31 13:14:22 +00:00
Christophe Dumez
39d4af1d6e - Updated Ukrainian translation (BlaXpirit) 2010-01-30 18:53:25 +00:00
Christophe Dumez
2e8f50b709 Fix compilation error when geoip database is embedded 2010-01-29 19:05:12 +00:00
Christophe Dumez
fdccf9cc1c Added support for HTTP redirection in downlaod threadOF 2010-01-29 18:42:20 +00:00
Christophe Dumez
31819e148f BUGFIX: Make sure bandwidth limiting dialogs are centered on screen 2010-01-27 20:37:35 +00:00
Christophe Dumez
5371fb15f8 BUGFIX: Fix "Append .!qB extension to complete files" (libtorrent v0.15) 2010-01-26 08:08:26 +00:00
Christophe Dumez
f845acb207 Optimized transfer list repainting
Improved user friendliness of data units
2010-01-24 18:11:56 +00:00
Christophe Dumez
f42eec5ad9 - Not calling repaint() manually. 2010-01-24 17:17:12 +00:00
Christophe Dumez
ec1a06d7c8 BUGFIX: Fix race condition in RSS that could cause a crash on startup 2010-01-24 16:50:48 +00:00
Christophe Dumez
e9b6a726e3 - Bump to v2.1.2 2010-01-24 16:21:55 +00:00
Christophe Dumez
a3f54fc3b9 - Added back file prioritizing 2010-01-24 16:10:39 +00:00
Christophe Dumez
10f58b4eed Nox compilation fix 2010-01-24 12:09:03 +00:00
Christophe Dumez
52fef5ac38 - Delete tree item ourself aven if Qt is supposed to delete it (just to be on the safe side) 2010-01-24 11:15:20 +00:00
Christophe Dumez
4d0cdea1c9 Make sure invalid torrent are removed from the transfer list 2010-01-23 19:17:31 +00:00
Christophe Dumez
86ca755dfe BUGFIX: Fix issue causing torrents not to be displayed in the list 2010-01-23 19:04:44 +00:00
Christophe Dumez
659664509a Improved RSS articles publication date handling 2010-01-23 16:18:39 +00:00
Christophe Dumez
412f947db5 "Open destination folder" now opens torrent root folder (if it contains one) instead of the parent folder 2010-01-23 09:57:10 +00:00
Christophe Dumez
ad47565b93 COSMETIC: Improved transfer speed display in peers list 2010-01-22 00:03:27 +00:00
Christophe Dumez
89175ea827 Make sure torrent deletion dialog is now centered on screen 2010-01-21 22:28:52 +00:00
Christophe Dumez
8dc34463e3 Improved previous patch: Force recheck only if we detected that renaming overwrited an existing file 2010-01-21 21:18:46 +00:00
Christophe Dumez
cab38857d1 BUGFIX: Force a recheck after renaming files to avoid overwriting 2010-01-21 20:39:43 +00:00
Christophe Dumez
14db21c241 BUGFIX: Fix overwrite check when renaming a folder in a torrent 2010-01-21 18:39:12 +00:00
Christophe Dumez
975ab9ad64 - Updated v2.1.1 release date 2010-01-20 19:10:52 +00:00
Christophe Dumez
b810278452 - Updated Polish translation 2010-01-20 19:10:10 +00:00
Christophe Dumez
86ac0a430e "Add in pause" setting is no longer ignored if torrent is loaded from a watched directory 2010-01-20 18:55:33 +00:00
Christophe Dumez
78a0f34645 BUGFIX: Fix "open torrent destination" feature when path contains spaces 2010-01-20 18:43:45 +00:00
Christophe Dumez
3ae09658c9 - Updated Russian translation 2010-01-20 18:38:22 +00:00
Christophe Dumez
7d9caad31e Paused torrents can now be rechecked 2010-01-20 18:06:56 +00:00
Christophe Dumez
c9c627dec2 Updated Hungarian translation 2010-01-20 16:03:26 +00:00
Christophe Dumez
5b104cdd9b BUGFIX: Can listen on ports < 1024 (must be root) 2010-01-20 10:00:08 +00:00
Christophe Dumez
8f667dce5c - Bump to v2.1.1 2010-01-20 09:45:47 +00:00
Christophe Dumez
89412e5050 - Updated Simplified Chinese translation (Legal notice was missing) 2010-01-20 09:42:19 +00:00
Christophe Dumez
63c121ecc7 - Fix typo in legal notice (startup) 2010-01-20 09:27:18 +00:00
Christophe Dumez
33b60779d6 BUGFIX: Fix renaming of files with unicode characters in their name 2010-01-20 08:48:11 +00:00
Christophe Dumez
26b2367833 Add in pause settings can be ignored from torrent addition dialog 2010-01-20 08:37:53 +00:00
Christophe Dumez
9b40a036a7 BUGFIX: Torrent added from magnet links were not remembered on restart 2010-01-19 23:48:04 +00:00
Christophe Dumez
d4cc0e9e4a Improved configure file output 2010-01-19 23:14:59 +00:00
Christophe Dumez
ca802a6233 BUGFIX: Configure file now checks for pkg-config executable which is required 2010-01-19 23:00:29 +00:00
Christophe Dumez
35394c4966 BUGFIX: Nox version no longer requires libQtXml 2010-01-19 22:55:15 +00:00
Christophe Dumez
077dd11af6 - Fix renaming of folders in a torrent (could rename children sometimes) 2010-01-19 22:43:59 +00:00
Christophe Dumez
a5c9c8d670 BUGFIX: Save torrent metadata so that it does not have to be re-downloaded on restart (Magnet links) 2010-01-19 21:54:17 +00:00
Christophe Dumez
1ef0bcbc06 - Removed useless include in project file 2010-01-19 00:19:40 +00:00
Christophe Dumez
e15eab9b6a - Fix compilation with Qt4.4 2010-01-18 22:10:38 +00:00
Christophe Dumez
8f1c56babd branched v2.1.x series 2010-01-18 19:03:29 +00:00
101 changed files with 6182 additions and 5328 deletions

View File

@@ -1,3 +1,62 @@
* Thu Mar 4 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.1.6
- BUGFIX: Fix Web UI authentication with Konqueror
- BUGFIX: Fix save path display in properties
- BUGFIX: Fix ratio calculation for directly seeded torrents (Thanks phorane)
- BUGFIX: Fix memory leak in RSS parser
- BUGFIX: Only one log window can be opened at a time
- BUGFIX: Command-line parameters are no longer required to be in UTF-8
* Web Feb 10 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.1.5
- BUGFIX: Fix actions on selected torrents (non-selected torrents could be affected)
- BUGFIX: Only one program preferences dialog is allowed at a time
- BUGFIX: Link against boost and ssl to fix issues with gold linker
- BUGFIX: Fix memory leak in RSS
- BUGFIX: Improved HTTP gzip compression detection in downloader
- BUGFIX: Fix possible race condition in search engine
* Mon Feb 8 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.1.4
- BUGFIX: Fix file prioritizing in a torrent
- BUGFIX: Make sure seeding torrents display a progress of 100%
- BUGFIX: Usage display was improved and localized (--help)
- BUGFIX: Fix possible crash when deleting a torrent
- BUGFIX: Fix possible crash when changing torrents label
* Sun Jan 31 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.1.3
- BUGFIX: Fix "Append .!qB extension to complete files" (libtorrent v0.15)
- BUGFIX: Make sure bandwidth limiting dialogs are centered on screen
- BUGFIX: Added support for HTTP redirection
- BUGFIX: Fix compilation error when geoip database is embedded
- BUGFIX: Fix crash when double-clicking on a torrent that has no metadata to open its save path
- BUGFIX: Fix Scan directory preferences in Web UI
- BUGFIX: Clear torrent error state when resuming it
* Sun Jan 24 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.1.2
- FEATURE: Added back file prioritizing in a torrent
- BUGFIX: Fix issue causing torrents not to be displayed in the list
- BUGFIX: Make sure invalid torrent are removed from the transfer list
- BUGFIX: Fix overwrite check when renaming a folder in a torrent
- BUGFIX: Force a recheck after renaming files to avoid overwriting
- BUGFIX: Improve "Open destination folder" behavior
- BUGFIX: Fix race condition in RSS that could cause a crash on startup
- BUGFIX: Improved user friendlyness of size units
- BUGFIX: Optimized transfer list repainting
- COSMETIC: Improved transfer speed display in peers list
* Wed Jan 20 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.1.1
- BUGFIX: Fix compilation with Qt4.4
- BUGFIX: Save torrent metadata so that it does not have to be re-downloaded on restart (Magnet links)
- BUGFIX: Fix folder renaming in a torrent (would rename children under certain conditions)
- BUGFIX: Nox version no longer requires libQtXml
- BUGFIX: Configure file now checks for pkg-config executable which is required
- BUGFIX: Torrents added from magnet links were not remembered on restart
- BUGFIX: "Add in pause" setting can be ignored from torrent addition dialog
- BUGFIX: Fix renaming of files with unicode characters in their name
- BUGFIX: Fix typo in legal notice (startup)
- BUGFIX: Can listen on ports < 1024 (must be root)
- BUGFIX: Paused torrents can now be rechecked
- BUGFIX: Fix "open torrent destination" feature when path contains spaces
- I18N: Updated translations (Hungarian, Chinese, Russian)
* Mon Jan 18 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.1.0
- FEATURE: Graphical User Interface can be disabled at compilation time (headless running)
- FEATURE: Torrents can be labeled/categorized

View File

@@ -12,6 +12,8 @@ qBittorrent - A BitTorrent client in C++ / Qt4
Dependencies:
- Qt >= 4.4.0 (libqt-devel, libqtgui, libqtcore, libqtnetwork, libqtxml)
- pkg-config executable
- libtorrent-rasterbar by Arvid Norberg (>= 0.14.4 REQUIRED, >= v0.15.0 ADVISED)
-> http://www.libtorrent.net
Be careful: another library (the one used by rTorrent) uses a similar name.
@@ -38,9 +40,11 @@ qBittorrent - A BitTorrent client in C++ / Qt4
will install and execute qBittorrent hopefully without any problems.
Dependencies:
- Qt >= 4.4.0 (libqt-devel, libqtcore, libqtnetwork, libqtxml)
- Qt >= 4.4.0 (libqt-devel, libqtcore, libqtnetwork)
- libtorrent-rasterbar by Arvid Norberg (>= 0.14.0 REQUIRED, >= v0.15.0 ADVISED)
- pkg-config executable
- libtorrent-rasterbar by Arvid Norberg (>= 0.14.4 REQUIRED, >= v0.15.0 ADVISED)
-> http://www.libtorrent.net
Be careful: another library (the one used by rTorrent) uses a similar name.

52
configure vendored
View File

@@ -319,6 +319,23 @@ public:
}
};
#line 1 "pkg-config.qcm"
/*
-----BEGIN QCMOD-----
name: pkg-config
-----END QCMOD-----
*/
#include <QProcess>
class qc_pkg_config : public ConfObj
{
public:
qc_pkg_config(Conf *c) : ConfObj(c) {}
QString name() const { return "pkg-config executable"; }
QString shortname() const { return "pkg-config"; }
bool exec(){
return !conf->findProgram("pkg-config").isEmpty();
}
};
#line 1 "libtorrent-rasterbar.qcm"
/*
-----BEGIN QCMOD-----
@@ -342,12 +359,18 @@ public:
return false;
for(int n = 0; n < incs.count(); ++n)
conf->addIncludePath(incs[n]);
if(!libs.isEmpty())
conf->addLib(libs);
//if(!libs.isEmpty())
// conf->addLib(libs);
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, adv_ver, &version, &incs, &libs, &other))
printf("\nWarning: libtorrent-rasterbar v%s was detected.\nSome feature will be disabled because they require v%s.\n", version.toLocal8Bit().data(), adv_ver.toUtf8().data());
printf("\nWarning: libtorrent-rasterbar v%s was detected. Some feature will be disabled because they require v%s.\n", version.toLocal8Bit().data(), adv_ver.toUtf8().data());
else
conf->addDefine("LIBTORRENT_0_15");
// Get linking parameters
QStringList params;
QByteArray staticlibs;
params << "--static" << "--libs" << "libtorrent-rasterbar";
conf->doCommand("pkg-config", params, &staticlibs);
conf->addLib(staticlibs.trimmed());
return true;
}
};
@@ -421,10 +444,14 @@ public:
qc_libnotify(Conf *c) : ConfObj(c) {}
QString name() const { return "libnotify >= 0.4.2 (optional)"; }
QString shortname() const { return "libnotify"; }
QString checkString() const {
if(!conf->getenv("QC_DISABLE_libnotify").isEmpty() || !conf->getenv("QC_DISABLE_GUI").isEmpty())
return "";
return ConfObj::checkString();
}
bool exec(){
if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) {
printf("\nNot Required");
return true;
if(!conf->getenv("QC_DISABLE_libnotify").isEmpty() || !conf->getenv("QC_DISABLE_GUI").isEmpty()) {
return false;
}
QStringList incs;
QString req_ver = "0.4.2";
@@ -468,10 +495,14 @@ public:
qc_geoip_database(Conf *c) : ConfObj(c) {}
QString name() const { return "GeoIP Database (optional)"; }
QString shortname() const { return "GeoIP Database"; }
QString checkString() const {
if(!conf->getenv("QC_DISABLE_geoip_database").isEmpty() || !conf->getenv("QC_DISABLE_GUI").isEmpty())
return "";
return ConfObj::checkString();
}
bool exec() {
if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) {
printf("\nNot Required");
return true;
if(!conf->getenv("QC_DISABLE_geoip_database").isEmpty() || !conf->getenv("QC_DISABLE_GUI").isEmpty()) {
return false;
}
#ifdef Q_WS_X11
if(!conf->getenv("QC_WITH_GEOIP_DATABASE_EMBEDDED").isEmpty()) {
@@ -494,6 +525,9 @@ cat >$1/modules_new.cpp <<EOT
o = new qc_qt4(conf);
o->required = true;
o->disabled = false;
o = new qc_pkg_config(conf);
o->required = true;
o->disabled = false;
o = new qc_libtorrent_rasterbar(conf);
o->required = true;
o->disabled = false;

View File

@@ -1,6 +1,4 @@
TEMPLATE = subdirs
include(conf.pri)
SUBDIRS += src

View File

@@ -6,6 +6,9 @@
<dep type='qt4'>
<required/>
</dep>
<dep type='pkg-config'>
<required/>
</dep>
<dep type='libtorrent-rasterbar'>
<required/>
</dep>

View File

@@ -11,10 +11,14 @@ public:
qc_geoip_database(Conf *c) : ConfObj(c) {}
QString name() const { return "GeoIP Database (optional)"; }
QString shortname() const { return "GeoIP Database"; }
QString checkString() const {
if(!conf->getenv("QC_DISABLE_geoip_database").isEmpty() || !conf->getenv("QC_DISABLE_GUI").isEmpty())
return "";
return ConfObj::checkString();
}
bool exec() {
if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) {
printf("\nNot Required");
return true;
if(!conf->getenv("QC_DISABLE_geoip_database").isEmpty() || !conf->getenv("QC_DISABLE_GUI").isEmpty()) {
return false;
}
#ifdef Q_WS_X11
if(!conf->getenv("QC_WITH_GEOIP_DATABASE_EMBEDDED").isEmpty()) {

View File

@@ -10,10 +10,14 @@ public:
qc_libnotify(Conf *c) : ConfObj(c) {}
QString name() const { return "libnotify >= 0.4.2 (optional)"; }
QString shortname() const { return "libnotify"; }
QString checkString() const {
if(!conf->getenv("QC_DISABLE_libnotify").isEmpty() || !conf->getenv("QC_DISABLE_GUI").isEmpty())
return "";
return ConfObj::checkString();
}
bool exec(){
if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) {
printf("\nNot Required");
return true;
if(!conf->getenv("QC_DISABLE_libnotify").isEmpty() || !conf->getenv("QC_DISABLE_GUI").isEmpty()) {
return false;
}
QStringList incs;
QString req_ver = "0.4.2";

View File

@@ -20,12 +20,18 @@ public:
return false;
for(int n = 0; n < incs.count(); ++n)
conf->addIncludePath(incs[n]);
if(!libs.isEmpty())
conf->addLib(libs);
//if(!libs.isEmpty())
// conf->addLib(libs);
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, adv_ver, &version, &incs, &libs, &other))
printf("\nWarning: libtorrent-rasterbar v%s was detected.\nSome feature will be disabled because they require v%s.\n", version.toLocal8Bit().data(), adv_ver.toUtf8().data());
printf("\nWarning: libtorrent-rasterbar v%s was detected. Some feature will be disabled because they require v%s.\n", version.toLocal8Bit().data(), adv_ver.toUtf8().data());
else
conf->addDefine("LIBTORRENT_0_15");
// Get linking parameters
QStringList params;
QByteArray staticlibs;
params << "--static" << "--libs" << "libtorrent-rasterbar";
conf->doCommand("pkg-config", params, &staticlibs);
conf->addLib(staticlibs.trimmed());
return true;
}
};

16
qcm/pkg-config.qcm Normal file
View File

@@ -0,0 +1,16 @@
/*
-----BEGIN QCMOD-----
name: pkg-config
-----END QCMOD-----
*/
#include <QProcess>
class qc_pkg_config : public ConfObj
{
public:
qc_pkg_config(Conf *c) : ConfObj(c) {}
QString name() const { return "pkg-config executable"; }
QString shortname() const { return "pkg-config"; }
bool exec(){
return !conf->findProgram("pkg-config").isEmpty();
}
};

View File

@@ -35,7 +35,6 @@
#include <QFileDialog>
#include <QMessageBox>
#include <QDesktopWidget>
#include <QTimer>
#include <QDesktopServices>
#include <QStatusBar>
@@ -218,7 +217,10 @@ GUI::~GUI() {
delete status_bar;
delete transferList;
delete guiUpdater;
if (console)
delete console;
if(options)
delete options;
if(rssWidget)
delete rssWidget;
delete searchEngine;
@@ -356,7 +358,7 @@ void GUI::readSettings() {
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
settings.beginGroup(QString::fromUtf8("MainWindow"));
resize(settings.value(QString::fromUtf8("size"), size()).toSize());
move(settings.value(QString::fromUtf8("pos"), screenCenter()).toPoint());
move(settings.value(QString::fromUtf8("pos"), misc::screenCenter(this)).toPoint());
QStringList sizes_str = settings.value("vSplitterSizes", QStringList()).toStringList();
// Splitter size
QList<int> sizes;
@@ -394,7 +396,7 @@ void GUI::readParamsOnSocket() {
if(clientConnection) {
QByteArray params = clientConnection->readAll();
if(!params.isEmpty()) {
processParams(QString::fromUtf8(params.data()).split(QString::fromUtf8("\n")));
processParams(QString::fromLocal8Bit(params.constData()).split("\n"));
qDebug("Received parameters from another instance");
}
clientConnection->deleteLater();
@@ -421,7 +423,11 @@ void GUI::on_actionSet_global_upload_limit_triggered() {
}
void GUI::on_actionShow_console_triggered() {
new consoleDlg(this, BTSession);
if(!console) {
console = new consoleDlg(this, BTSession);
} else {
console->setFocus();
}
}
void GUI::on_actionSet_global_download_limit_triggered() {
@@ -475,22 +481,6 @@ void GUI::toggleVisibility(QSystemTrayIcon::ActivationReason e) {
}
}
// Center window
QPoint GUI::screenCenter() const{
int scrn = 0;
QWidget *w = this->topLevelWidget();
if(w)
scrn = QApplication::desktop()->screenNumber(w);
else if(QApplication::desktop()->isVirtualDesktop())
scrn = QApplication::desktop()->screenNumber(QCursor::pos());
else
scrn = QApplication::desktop()->screenNumber(this);
QRect desk(QApplication::desktop()->availableGeometry(scrn));
return QPoint((desk.width() - this->frameGeometry().width()) / 2, (desk.height() - this->frameGeometry().height()) / 2);
}
// Display About Dialog
void GUI::on_actionAbout_triggered() {
//About dialog
@@ -925,8 +915,13 @@ void GUI::createTrayIcon() {
// Display Program Options
void GUI::on_actionOptions_triggered() {
options = new options_imp(this);
connect(options, SIGNAL(status_changed()), this, SLOT(optionsSaved()));
if(!options) {
options = new options_imp(this);
connect(options, SIGNAL(status_changed()), this, SLOT(optionsSaved()));
} else {
// Get focus
options->setFocus();
}
}
/*****************************************************

View File

@@ -55,6 +55,7 @@ class TransferListFiltersWidget;
class QSplitter;
class PropertiesWidget;
class StatusBar;
class consoleDlg;
class GUI : public QMainWindow, private Ui::MainWindow{
Q_OBJECT
@@ -68,6 +69,7 @@ private:
QTabWidget *tabs;
StatusBar *status_bar;
QPointer<options_imp> options;
QPointer<consoleDlg> console;
QPointer<QSystemTrayIcon> systrayIcon;
QPointer<QTimer> systrayCreator;
QMenu *myTrayIconMenu;
@@ -156,7 +158,6 @@ public:
~GUI();
// Methods
int getCurrentTabIndex() const;
QPoint screenCenter() const;
TransferListWidget* getTransferList() const { return transferList; }
};

View File

@@ -1,6 +1,6 @@
[Desktop Entry]
Categories=Qt;Network;P2P;
Comment=V2.1.0
Comment=V2.1.6
Exec=qbittorrent %f
GenericName=Bittorrent client
GenericName[bg]=Торент клиент

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB

View File

@@ -746,15 +746,18 @@ QTorrentHandle Bittorrent::addMagnetUri(QString magnet_uri, bool resumed) {
addConsoleMessage(tr("'%1' is not a valid magnet URI.").arg(magnet_uri));
return h;
}
QDir torrentBackup(misc::BTBackupLocation());
if(resumed) {
qDebug("Resuming magnet URI: %s", hash.toLocal8Bit().data());
// Load metadata
if(QFile::exists(torrentBackup.path()+QDir::separator()+hash+QString(".torrent")))
return addTorrent(torrentBackup.path()+QDir::separator()+hash+QString(".torrent"), false, false, true);
} else {
qDebug("Adding new magnet URI");
}
bool fastResume=false;
Q_ASSERT(magnet_uri.startsWith("magnet:"));
QDir torrentBackup(misc::BTBackupLocation());
// Check if torrent is already in download list
if(s->find_torrent(sha1_hash(hash.toLocal8Bit().data())).is_valid()) {
@@ -799,7 +802,7 @@ QTorrentHandle Bittorrent::addMagnetUri(QString magnet_uri, bool resumed) {
else
p.storage_mode = storage_mode_sparse;
// Start in pause
p.paused = false;
p.paused = true;
p.duplicate_is_error = false; // Already checked
p.auto_managed = false; // Because it is added in paused state
// Adding torrent to Bittorrent session
@@ -839,7 +842,7 @@ QTorrentHandle Bittorrent::addMagnetUri(QString magnet_uri, bool resumed) {
}
QString label = TorrentTempData::getLabel(hash);
// Save persistent data for new torrent
TorrentPersistentData::saveTorrentPersistentData(h);
TorrentPersistentData::saveTorrentPersistentData(h, true);
// Save Label
if(!label.isEmpty()) {
TorrentPersistentData::saveLabel(hash, label);
@@ -850,7 +853,7 @@ QTorrentHandle Bittorrent::addMagnetUri(QString magnet_uri, bool resumed) {
TorrentPersistentData::saveSavePath(hash, savePath);
}
}
if(!addInPause && !fastResume) {
if(!fastResume && (!addInPause || (Preferences::useAdditionDialog()))) {
// Start torrent because it was added in paused state
h.resume();
}
@@ -1020,11 +1023,16 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
h.set_sequential_download(TorrentTempData::isSequential(hash));
// Import Files names from torrent addition dialog
QStringList files_path = TorrentTempData::getFilesPath(hash);
bool force_recheck = false;
if(files_path.size() == h.num_files()) {
for(int i=0; i<h.num_files(); ++i) {
QString path = files_path.at(i);
if(!force_recheck && QFile::exists(h.save_path()+QDir::separator()+path))
force_recheck = true;
h.rename_file(i, path);
}
// Force recheck
if(force_recheck) h.force_recheck();
}
}
QString label = TorrentTempData::getLabel(hash);
@@ -1053,7 +1061,7 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
// Copy it to torrentBackup directory
QFile::copy(file, newFile);
}
if(!addInPause && !fastResume) {
if(!fastResume && (!addInPause || (Preferences::useAdditionDialog() && !fromScanDir))) {
// Start torrent because it was added in paused state
h.resume();
}
@@ -1224,14 +1232,14 @@ bool Bittorrent::enableDHT(bool b) {
float Bittorrent::getRealRatio(QString hash) const{
QTorrentHandle h = getTorrentHandle(hash);
Q_ASSERT(h.all_time_download() >= 0);
Q_ASSERT(h.total_done() >= 0);
Q_ASSERT(h.all_time_upload() >= 0);
if(h.all_time_download() == 0) {
if(h.total_done() == 0) {
if(h.all_time_upload() == 0)
return 0;
return 101;
}
float ratio = (float)h.all_time_upload()/(float)h.all_time_download();
float ratio = (float)h.all_time_upload()/(float)h.total_done();
Q_ASSERT(ratio >= 0.);
if(ratio > 100.)
ratio = 100.;
@@ -1599,9 +1607,9 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
}
}
// Set DHT port (>= 1000 or 0 if same as BT)
// Set DHT port (>= 1 or 0 if same as BT)
void Bittorrent::setDHTPort(int dht_port) {
if(dht_port == 0 || dht_port >= 1000) {
if(dht_port >= 0) {
if(dht_port == current_dht_port) return;
struct dht_settings DHTSettings;
DHTSettings.service_port = dht_port;
@@ -1667,7 +1675,7 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
qDebug("Disabling HTTP communications proxy");
#ifdef Q_WS_WIN
putenv("http_proxy=");
putenv("sock_proxy=")
putenv("sock_proxy=");
#else
unsetenv("http_proxy");
unsetenv("sock_proxy");
@@ -1703,6 +1711,11 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
QString hash = h.hash();
// Remember finished state
TorrentPersistentData::saveSeedStatus(h);
#ifdef LIBTORRENT_0_15
// Remove .!qB extension if necessary
if(appendqBExtension)
appendqBextensionToTorrent(h, false);
#endif
// Move to download directory if necessary
if(!defaultTempPath.isEmpty()) {
// Check if directory is different
@@ -1767,6 +1780,10 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
appendqBextensionToTorrent(h, true);
#endif
emit metadataReceived(h);
// Save metadata
QDir torrentBackup(misc::BTBackupLocation());
if(!QFile::exists(torrentBackup.path()+QDir::separator()+h.hash()+QString(".torrent")))
h.save_torrent_file(torrentBackup.path()+QDir::separator()+h.hash()+QString(".torrent"));
if(h.is_paused()) {
// XXX: Unfortunately libtorrent-rasterbar does not send a torrent_paused_alert
// and the torrent can be paused when metadata is received
@@ -1908,12 +1925,30 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
}
emit torrentFinishedChecking(h);
emit metadataReceived(h);
if(torrentsToPausedAfterChecking.contains(hash)) {
torrentsToPausedAfterChecking.removeOne(hash);
h.pause();
emit pausedTorrent(h);
}
}
}
a = s->pop_alert();
}
}
void Bittorrent::recheckTorrent(QString hash) {
QTorrentHandle h = getTorrentHandle(hash);
if(h.is_valid() && h.has_metadata()) {
if(h.is_paused()) {
if(!torrentsToPausedAfterChecking.contains(h.hash())) {
torrentsToPausedAfterChecking << h.hash();
h.resume();
}
}
h.force_recheck();
}
}
QHash<QString, TrackerInfos> Bittorrent::getTrackersInfo(QString hash) const{
return trackersInfos.value(hash, QHash<QString, TrackerInfos>());
}

View File

@@ -94,6 +94,7 @@ private:
QPointer<QTimer> timerAlerts;
QMap<QUrl, QString> savepath_fromurl;
QHash<QString, QHash<QString, TrackerInfos> > trackersInfos;
QStringList torrentsToPausedAfterChecking;
// Ratio
QPointer<QTimer> BigRatioTimer;
// HTTP
@@ -180,6 +181,7 @@ public slots:
void deleteTorrent(QString hash, bool delete_local_files = false);
void startUpTorrents();
session_proxy asyncDeletion();
void recheckTorrent(QString hash);
/* Needed by Web UI */
void pauseAllTorrents();
void pauseTorrent(QString hash);

View File

@@ -33,6 +33,7 @@
#include <QDialog>
#include "ui_confirmdeletiondlg.h"
#include "misc.h"
class DeletionConfirmationDlg : public QDialog, private Ui::confirmDeletionDlg {
Q_OBJECT
@@ -40,6 +41,7 @@ class DeletionConfirmationDlg : public QDialog, private Ui::confirmDeletionDlg {
public:
DeletionConfirmationDlg(QWidget *parent=0): QDialog(parent) {
setupUi(this);
move(misc::screenCenter(this));
}
bool shouldDeleteLocalFiles() const {

View File

@@ -56,6 +56,18 @@ void downloadThread::processDlFinished(QNetworkReply* reply) {
// Failure
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", url.toLocal8Bit().data(), redirection.toUrl().toString().toLocal8Bit().data());
redirect_mapping.insert(redirection.toUrl().toString(), url);
downloadUrl(redirection.toUrl().toString());
return;
}
// Checking if it was redirecting, restoring initial URL
if(redirect_mapping.contains(url)) {
url = redirect_mapping.take(url);
}
// Success
QString filePath;
QTemporaryFile tmpfile;
@@ -91,6 +103,7 @@ void downloadThread::downloadUrl(QString url){
// Spoof Firefox 3.5 user agent to avoid
// Web server banning
request.setRawHeader("User-Agent", "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5");
request.setRawHeader("Accept-Encoding", "");
qDebug("Downloading %s...", request.url().toString().toLocal8Bit().data());
networkManager->get(request);
}

View File

@@ -33,6 +33,7 @@
#include <QNetworkReply>
#include <QObject>
#include <QHash>
class QNetworkAccessManager;
@@ -41,6 +42,7 @@ class downloadThread : public QObject {
private:
QNetworkAccessManager *networkManager;
QHash<QString, QString> redirect_mapping;
signals:
void downloadFinished(QString url, QString file_path);

View File

@@ -282,7 +282,9 @@ QVariantMap EventManager::getPropGeneralInfo(QString hash) const {
QTorrentHandle h = BTSession->getTorrentHandle(hash);
if(h.is_valid() && h.has_metadata()) {
// Save path
data["save_path"] = TorrentPersistentData::getSavePath(hash);
QString p = TorrentPersistentData::getSavePath(hash);
if(p.isEmpty()) p = h.save_path();
data["save_path"] = p;
// Creation date
data["creation_date"] = h.creation_date();
// Comment

View File

@@ -154,7 +154,9 @@ signals:
protected slots:
void updateCurrentFeed(QTreeWidgetItem* new_item) {
if((new_item && getItemType(new_item) == RssFile::STREAM) || new_item == unread_item)
if(!new_item) return;
if(!mapping.contains(new_item)) return;
if((getItemType(new_item) == RssFile::STREAM) || new_item == unread_item)
current_feed = new_item;
}

View File

@@ -46,7 +46,7 @@ protected:
static QString geoipFolder(bool embedded=false) {
if(embedded)
return ":/geoip/";
return misc::qBittorrentPath()+"geoip"+QDir::separator();
return misc::QDesktopServicesDataLocation()+"geoip"+QDir::separator();
#else
static QString geoipFolder(bool) {
if(QFile::exists("/usr/local/share/GeoIP/GeoIP.dat"))

View File

@@ -138,6 +138,7 @@ void HttpConnection::respond() {
return;
}
QString auth = parser.value("Authorization");
qDebug("Auth: %s", auth.split(" ").first().toLocal8Bit().data());
if (QString::compare(auth.split(" ").first(), "Digest", Qt::CaseInsensitive) != 0 || !parent->isAuthorized(auth.toLocal8Bit(), parser.method())) {
// Update failed attempt counter
parent->client_failed_attempts.insert(socket->peerAddress().toString(), nb_fail+1);
@@ -456,8 +457,8 @@ void HttpConnection::respondCommand(QString command)
void HttpConnection::recheckTorrent(QString hash) {
QTorrentHandle h = BTSession->getTorrentHandle(hash);
if(h.is_valid() && !h.is_paused()){
h.force_recheck();
if(h.is_valid()){
BTSession->recheckTorrent(h.hash());
}
}
@@ -466,7 +467,7 @@ void HttpConnection::recheckAllTorrents() {
std::vector<torrent_handle>::iterator torrentIT;
for(torrentIT = torrents.begin(); torrentIT != torrents.end(); torrentIT++) {
QTorrentHandle h = QTorrentHandle(*torrentIT);
if(h.is_valid() && !h.is_paused())
h.force_recheck();
if(h.is_valid())
BTSession->recheckTorrent(h.hash());
}
}

View File

@@ -207,7 +207,7 @@ bool HttpServer::isAuthorized(QByteArray auth, QString method) const {
}
QByteArray prop_cnonce = regex_cnonce.cap(1).toLocal8Bit();
qDebug("prop cnonce is: %s", prop_cnonce.data());
QRegExp regex_qop(".*qop=(\\w+).*");
QRegExp regex_qop(".*qop=[\"]?(\\w+)[\"]?.*");
if(regex_qop.indexIn(auth) < 0) {
qDebug("AUTH-PROB: missing qop");
return false;

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More