You've already forked qBittorrent
mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-10-14 11:52:15 +02:00
Compare commits
58 Commits
release-2.
...
release-2.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
89c9a646ad | ||
![]() |
1ee45151a1 | ||
![]() |
772f05c5d4 | ||
![]() |
de9e215404 | ||
![]() |
eeabf85e3b | ||
![]() |
6b99c84fe3 | ||
![]() |
7d42969505 | ||
![]() |
90351c4a57 | ||
![]() |
492b9dc88f | ||
![]() |
c9a8c1d053 | ||
![]() |
c8fdf8dc10 | ||
![]() |
119f83fbf0 | ||
![]() |
e8db20a558 | ||
![]() |
508a811a8a | ||
![]() |
296267ec20 | ||
![]() |
39d4af1d6e | ||
![]() |
2e8f50b709 | ||
![]() |
fdccf9cc1c | ||
![]() |
31819e148f | ||
![]() |
5371fb15f8 | ||
![]() |
f845acb207 | ||
![]() |
f42eec5ad9 | ||
![]() |
ec1a06d7c8 | ||
![]() |
e9b6a726e3 | ||
![]() |
a3f54fc3b9 | ||
![]() |
10f58b4eed | ||
![]() |
52fef5ac38 | ||
![]() |
4d0cdea1c9 | ||
![]() |
86ca755dfe | ||
![]() |
659664509a | ||
![]() |
412f947db5 | ||
![]() |
ad47565b93 | ||
![]() |
89175ea827 | ||
![]() |
8dc34463e3 | ||
![]() |
cab38857d1 | ||
![]() |
14db21c241 | ||
![]() |
975ab9ad64 | ||
![]() |
b810278452 | ||
![]() |
86ac0a430e | ||
![]() |
78a0f34645 | ||
![]() |
3ae09658c9 | ||
![]() |
7d9caad31e | ||
![]() |
c9c627dec2 | ||
![]() |
5b104cdd9b | ||
![]() |
8f667dce5c | ||
![]() |
89412e5050 | ||
![]() |
63c121ecc7 | ||
![]() |
33b60779d6 | ||
![]() |
26b2367833 | ||
![]() |
9b40a036a7 | ||
![]() |
d4cc0e9e4a | ||
![]() |
ca802a6233 | ||
![]() |
35394c4966 | ||
![]() |
077dd11af6 | ||
![]() |
a5c9c8d670 | ||
![]() |
1ef0bcbc06 | ||
![]() |
e15eab9b6a | ||
![]() |
8f1c56babd |
43
Changelog
43
Changelog
@@ -1,3 +1,46 @@
|
|||||||
|
* 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
|
* 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: Graphical User Interface can be disabled at compilation time (headless running)
|
||||||
- FEATURE: Torrents can be labeled/categorized
|
- FEATURE: Torrents can be labeled/categorized
|
||||||
|
8
INSTALL
8
INSTALL
@@ -12,6 +12,8 @@ qBittorrent - A BitTorrent client in C++ / Qt4
|
|||||||
Dependencies:
|
Dependencies:
|
||||||
- Qt >= 4.4.0 (libqt-devel, libqtgui, libqtcore, libqtnetwork, libqtxml)
|
- 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)
|
- libtorrent-rasterbar by Arvid Norberg (>= 0.14.4 REQUIRED, >= v0.15.0 ADVISED)
|
||||||
-> http://www.libtorrent.net
|
-> http://www.libtorrent.net
|
||||||
Be careful: another library (the one used by rTorrent) uses a similar name.
|
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.
|
will install and execute qBittorrent hopefully without any problems.
|
||||||
|
|
||||||
Dependencies:
|
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
|
-> http://www.libtorrent.net
|
||||||
Be careful: another library (the one used by rTorrent) uses a similar name.
|
Be careful: another library (the one used by rTorrent) uses a similar name.
|
||||||
|
|
||||||
|
42
configure
vendored
42
configure
vendored
@@ -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"
|
#line 1 "libtorrent-rasterbar.qcm"
|
||||||
/*
|
/*
|
||||||
-----BEGIN QCMOD-----
|
-----BEGIN QCMOD-----
|
||||||
@@ -345,7 +362,7 @@ public:
|
|||||||
if(!libs.isEmpty())
|
if(!libs.isEmpty())
|
||||||
conf->addLib(libs);
|
conf->addLib(libs);
|
||||||
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, adv_ver, &version, &incs, &libs, &other))
|
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
|
else
|
||||||
conf->addDefine("LIBTORRENT_0_15");
|
conf->addDefine("LIBTORRENT_0_15");
|
||||||
return true;
|
return true;
|
||||||
@@ -421,10 +438,14 @@ public:
|
|||||||
qc_libnotify(Conf *c) : ConfObj(c) {}
|
qc_libnotify(Conf *c) : ConfObj(c) {}
|
||||||
QString name() const { return "libnotify >= 0.4.2 (optional)"; }
|
QString name() const { return "libnotify >= 0.4.2 (optional)"; }
|
||||||
QString shortname() const { return "libnotify"; }
|
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(){
|
bool exec(){
|
||||||
if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
if(!conf->getenv("QC_DISABLE_libnotify").isEmpty() || !conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
||||||
printf("\nNot Required");
|
return false;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
QStringList incs;
|
QStringList incs;
|
||||||
QString req_ver = "0.4.2";
|
QString req_ver = "0.4.2";
|
||||||
@@ -468,10 +489,14 @@ public:
|
|||||||
qc_geoip_database(Conf *c) : ConfObj(c) {}
|
qc_geoip_database(Conf *c) : ConfObj(c) {}
|
||||||
QString name() const { return "GeoIP Database (optional)"; }
|
QString name() const { return "GeoIP Database (optional)"; }
|
||||||
QString shortname() const { return "GeoIP Database"; }
|
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() {
|
bool exec() {
|
||||||
if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
if(!conf->getenv("QC_DISABLE_geoip_database").isEmpty() || !conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
||||||
printf("\nNot Required");
|
return false;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
#ifdef Q_WS_X11
|
#ifdef Q_WS_X11
|
||||||
if(!conf->getenv("QC_WITH_GEOIP_DATABASE_EMBEDDED").isEmpty()) {
|
if(!conf->getenv("QC_WITH_GEOIP_DATABASE_EMBEDDED").isEmpty()) {
|
||||||
@@ -494,6 +519,9 @@ cat >$1/modules_new.cpp <<EOT
|
|||||||
o = new qc_qt4(conf);
|
o = new qc_qt4(conf);
|
||||||
o->required = true;
|
o->required = true;
|
||||||
o->disabled = false;
|
o->disabled = false;
|
||||||
|
o = new qc_pkg_config(conf);
|
||||||
|
o->required = true;
|
||||||
|
o->disabled = false;
|
||||||
o = new qc_libtorrent_rasterbar(conf);
|
o = new qc_libtorrent_rasterbar(conf);
|
||||||
o->required = true;
|
o->required = true;
|
||||||
o->disabled = false;
|
o->disabled = false;
|
||||||
|
@@ -1,6 +1,4 @@
|
|||||||
TEMPLATE = subdirs
|
TEMPLATE = subdirs
|
||||||
|
|
||||||
include(conf.pri)
|
|
||||||
|
|
||||||
SUBDIRS += src
|
SUBDIRS += src
|
||||||
|
|
||||||
|
@@ -6,6 +6,9 @@
|
|||||||
<dep type='qt4'>
|
<dep type='qt4'>
|
||||||
<required/>
|
<required/>
|
||||||
</dep>
|
</dep>
|
||||||
|
<dep type='pkg-config'>
|
||||||
|
<required/>
|
||||||
|
</dep>
|
||||||
<dep type='libtorrent-rasterbar'>
|
<dep type='libtorrent-rasterbar'>
|
||||||
<required/>
|
<required/>
|
||||||
</dep>
|
</dep>
|
||||||
|
@@ -11,10 +11,14 @@ public:
|
|||||||
qc_geoip_database(Conf *c) : ConfObj(c) {}
|
qc_geoip_database(Conf *c) : ConfObj(c) {}
|
||||||
QString name() const { return "GeoIP Database (optional)"; }
|
QString name() const { return "GeoIP Database (optional)"; }
|
||||||
QString shortname() const { return "GeoIP Database"; }
|
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() {
|
bool exec() {
|
||||||
if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
if(!conf->getenv("QC_DISABLE_geoip_database").isEmpty() || !conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
||||||
printf("\nNot Required");
|
return false;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
#ifdef Q_WS_X11
|
#ifdef Q_WS_X11
|
||||||
if(!conf->getenv("QC_WITH_GEOIP_DATABASE_EMBEDDED").isEmpty()) {
|
if(!conf->getenv("QC_WITH_GEOIP_DATABASE_EMBEDDED").isEmpty()) {
|
||||||
|
@@ -10,10 +10,14 @@ public:
|
|||||||
qc_libnotify(Conf *c) : ConfObj(c) {}
|
qc_libnotify(Conf *c) : ConfObj(c) {}
|
||||||
QString name() const { return "libnotify >= 0.4.2 (optional)"; }
|
QString name() const { return "libnotify >= 0.4.2 (optional)"; }
|
||||||
QString shortname() const { return "libnotify"; }
|
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(){
|
bool exec(){
|
||||||
if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
if(!conf->getenv("QC_DISABLE_libnotify").isEmpty() || !conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
||||||
printf("\nNot Required");
|
return false;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
QStringList incs;
|
QStringList incs;
|
||||||
QString req_ver = "0.4.2";
|
QString req_ver = "0.4.2";
|
||||||
|
@@ -23,7 +23,7 @@ public:
|
|||||||
if(!libs.isEmpty())
|
if(!libs.isEmpty())
|
||||||
conf->addLib(libs);
|
conf->addLib(libs);
|
||||||
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, adv_ver, &version, &incs, &libs, &other))
|
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
|
else
|
||||||
conf->addDefine("LIBTORRENT_0_15");
|
conf->addDefine("LIBTORRENT_0_15");
|
||||||
return true;
|
return true;
|
||||||
|
16
qcm/pkg-config.qcm
Normal file
16
qcm/pkg-config.qcm
Normal 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();
|
||||||
|
}
|
||||||
|
};
|
19
src/GUI.cpp
19
src/GUI.cpp
@@ -35,7 +35,6 @@
|
|||||||
|
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QDesktopWidget>
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QStatusBar>
|
#include <QStatusBar>
|
||||||
@@ -356,7 +355,7 @@ void GUI::readSettings() {
|
|||||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
settings.beginGroup(QString::fromUtf8("MainWindow"));
|
settings.beginGroup(QString::fromUtf8("MainWindow"));
|
||||||
resize(settings.value(QString::fromUtf8("size"), size()).toSize());
|
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();
|
QStringList sizes_str = settings.value("vSplitterSizes", QStringList()).toStringList();
|
||||||
// Splitter size
|
// Splitter size
|
||||||
QList<int> sizes;
|
QList<int> sizes;
|
||||||
@@ -475,22 +474,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
|
// Display About Dialog
|
||||||
void GUI::on_actionAbout_triggered() {
|
void GUI::on_actionAbout_triggered() {
|
||||||
//About dialog
|
//About dialog
|
||||||
|
@@ -156,7 +156,6 @@ public:
|
|||||||
~GUI();
|
~GUI();
|
||||||
// Methods
|
// Methods
|
||||||
int getCurrentTabIndex() const;
|
int getCurrentTabIndex() const;
|
||||||
QPoint screenCenter() const;
|
|
||||||
TransferListWidget* getTransferList() const { return transferList; }
|
TransferListWidget* getTransferList() const { return transferList; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Categories=Qt;Network;P2P;
|
Categories=Qt;Network;P2P;
|
||||||
Comment=V2.1.0
|
Comment=V2.1.4
|
||||||
Exec=qbittorrent %f
|
Exec=qbittorrent %f
|
||||||
GenericName=Bittorrent client
|
GenericName=Bittorrent client
|
||||||
GenericName[bg]=Торент клиент
|
GenericName[bg]=Торент клиент
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
@@ -746,15 +746,18 @@ QTorrentHandle Bittorrent::addMagnetUri(QString magnet_uri, bool resumed) {
|
|||||||
addConsoleMessage(tr("'%1' is not a valid magnet URI.").arg(magnet_uri));
|
addConsoleMessage(tr("'%1' is not a valid magnet URI.").arg(magnet_uri));
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
QDir torrentBackup(misc::BTBackupLocation());
|
||||||
if(resumed) {
|
if(resumed) {
|
||||||
qDebug("Resuming magnet URI: %s", hash.toLocal8Bit().data());
|
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 {
|
} else {
|
||||||
qDebug("Adding new magnet URI");
|
qDebug("Adding new magnet URI");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool fastResume=false;
|
bool fastResume=false;
|
||||||
Q_ASSERT(magnet_uri.startsWith("magnet:"));
|
Q_ASSERT(magnet_uri.startsWith("magnet:"));
|
||||||
QDir torrentBackup(misc::BTBackupLocation());
|
|
||||||
|
|
||||||
// Check if torrent is already in download list
|
// Check if torrent is already in download list
|
||||||
if(s->find_torrent(sha1_hash(hash.toLocal8Bit().data())).is_valid()) {
|
if(s->find_torrent(sha1_hash(hash.toLocal8Bit().data())).is_valid()) {
|
||||||
@@ -799,7 +802,7 @@ QTorrentHandle Bittorrent::addMagnetUri(QString magnet_uri, bool resumed) {
|
|||||||
else
|
else
|
||||||
p.storage_mode = storage_mode_sparse;
|
p.storage_mode = storage_mode_sparse;
|
||||||
// Start in pause
|
// Start in pause
|
||||||
p.paused = false;
|
p.paused = true;
|
||||||
p.duplicate_is_error = false; // Already checked
|
p.duplicate_is_error = false; // Already checked
|
||||||
p.auto_managed = false; // Because it is added in paused state
|
p.auto_managed = false; // Because it is added in paused state
|
||||||
// Adding torrent to Bittorrent session
|
// Adding torrent to Bittorrent session
|
||||||
@@ -839,7 +842,7 @@ QTorrentHandle Bittorrent::addMagnetUri(QString magnet_uri, bool resumed) {
|
|||||||
}
|
}
|
||||||
QString label = TorrentTempData::getLabel(hash);
|
QString label = TorrentTempData::getLabel(hash);
|
||||||
// Save persistent data for new torrent
|
// Save persistent data for new torrent
|
||||||
TorrentPersistentData::saveTorrentPersistentData(h);
|
TorrentPersistentData::saveTorrentPersistentData(h, true);
|
||||||
// Save Label
|
// Save Label
|
||||||
if(!label.isEmpty()) {
|
if(!label.isEmpty()) {
|
||||||
TorrentPersistentData::saveLabel(hash, label);
|
TorrentPersistentData::saveLabel(hash, label);
|
||||||
@@ -850,7 +853,7 @@ QTorrentHandle Bittorrent::addMagnetUri(QString magnet_uri, bool resumed) {
|
|||||||
TorrentPersistentData::saveSavePath(hash, savePath);
|
TorrentPersistentData::saveSavePath(hash, savePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!addInPause && !fastResume) {
|
if(!fastResume && (!addInPause || (Preferences::useAdditionDialog()))) {
|
||||||
// Start torrent because it was added in paused state
|
// Start torrent because it was added in paused state
|
||||||
h.resume();
|
h.resume();
|
||||||
}
|
}
|
||||||
@@ -1020,11 +1023,16 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
|
|||||||
h.set_sequential_download(TorrentTempData::isSequential(hash));
|
h.set_sequential_download(TorrentTempData::isSequential(hash));
|
||||||
// Import Files names from torrent addition dialog
|
// Import Files names from torrent addition dialog
|
||||||
QStringList files_path = TorrentTempData::getFilesPath(hash);
|
QStringList files_path = TorrentTempData::getFilesPath(hash);
|
||||||
|
bool force_recheck = false;
|
||||||
if(files_path.size() == h.num_files()) {
|
if(files_path.size() == h.num_files()) {
|
||||||
for(int i=0; i<h.num_files(); ++i) {
|
for(int i=0; i<h.num_files(); ++i) {
|
||||||
QString path = files_path.at(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);
|
h.rename_file(i, path);
|
||||||
}
|
}
|
||||||
|
// Force recheck
|
||||||
|
if(force_recheck) h.force_recheck();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QString label = TorrentTempData::getLabel(hash);
|
QString label = TorrentTempData::getLabel(hash);
|
||||||
@@ -1053,7 +1061,7 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
|
|||||||
// Copy it to torrentBackup directory
|
// Copy it to torrentBackup directory
|
||||||
QFile::copy(file, newFile);
|
QFile::copy(file, newFile);
|
||||||
}
|
}
|
||||||
if(!addInPause && !fastResume) {
|
if(!fastResume && (!addInPause || (Preferences::useAdditionDialog() && !fromScanDir))) {
|
||||||
// Start torrent because it was added in paused state
|
// Start torrent because it was added in paused state
|
||||||
h.resume();
|
h.resume();
|
||||||
}
|
}
|
||||||
@@ -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) {
|
void Bittorrent::setDHTPort(int dht_port) {
|
||||||
if(dht_port == 0 || dht_port >= 1000) {
|
if(dht_port >= 0) {
|
||||||
if(dht_port == current_dht_port) return;
|
if(dht_port == current_dht_port) return;
|
||||||
struct dht_settings DHTSettings;
|
struct dht_settings DHTSettings;
|
||||||
DHTSettings.service_port = dht_port;
|
DHTSettings.service_port = dht_port;
|
||||||
@@ -1667,7 +1675,7 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
|||||||
qDebug("Disabling HTTP communications proxy");
|
qDebug("Disabling HTTP communications proxy");
|
||||||
#ifdef Q_WS_WIN
|
#ifdef Q_WS_WIN
|
||||||
putenv("http_proxy=");
|
putenv("http_proxy=");
|
||||||
putenv("sock_proxy=")
|
putenv("sock_proxy=");
|
||||||
#else
|
#else
|
||||||
unsetenv("http_proxy");
|
unsetenv("http_proxy");
|
||||||
unsetenv("sock_proxy");
|
unsetenv("sock_proxy");
|
||||||
@@ -1703,6 +1711,11 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
|||||||
QString hash = h.hash();
|
QString hash = h.hash();
|
||||||
// Remember finished state
|
// Remember finished state
|
||||||
TorrentPersistentData::saveSeedStatus(h);
|
TorrentPersistentData::saveSeedStatus(h);
|
||||||
|
#ifdef LIBTORRENT_0_15
|
||||||
|
// Remove .!qB extension if necessary
|
||||||
|
if(appendqBExtension)
|
||||||
|
appendqBextensionToTorrent(h, false);
|
||||||
|
#endif
|
||||||
// Move to download directory if necessary
|
// Move to download directory if necessary
|
||||||
if(!defaultTempPath.isEmpty()) {
|
if(!defaultTempPath.isEmpty()) {
|
||||||
// Check if directory is different
|
// Check if directory is different
|
||||||
@@ -1767,6 +1780,10 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
|||||||
appendqBextensionToTorrent(h, true);
|
appendqBextensionToTorrent(h, true);
|
||||||
#endif
|
#endif
|
||||||
emit metadataReceived(h);
|
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()) {
|
if(h.is_paused()) {
|
||||||
// XXX: Unfortunately libtorrent-rasterbar does not send a torrent_paused_alert
|
// XXX: Unfortunately libtorrent-rasterbar does not send a torrent_paused_alert
|
||||||
// and the torrent can be paused when metadata is received
|
// and the torrent can be paused when metadata is received
|
||||||
@@ -1908,12 +1925,30 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
|||||||
}
|
}
|
||||||
emit torrentFinishedChecking(h);
|
emit torrentFinishedChecking(h);
|
||||||
emit metadataReceived(h);
|
emit metadataReceived(h);
|
||||||
|
if(torrentsToPausedAfterChecking.contains(hash)) {
|
||||||
|
torrentsToPausedAfterChecking.removeOne(hash);
|
||||||
|
h.pause();
|
||||||
|
emit pausedTorrent(h);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
a = s->pop_alert();
|
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{
|
QHash<QString, TrackerInfos> Bittorrent::getTrackersInfo(QString hash) const{
|
||||||
return trackersInfos.value(hash, QHash<QString, TrackerInfos>());
|
return trackersInfos.value(hash, QHash<QString, TrackerInfos>());
|
||||||
}
|
}
|
||||||
|
@@ -94,6 +94,7 @@ private:
|
|||||||
QPointer<QTimer> timerAlerts;
|
QPointer<QTimer> timerAlerts;
|
||||||
QMap<QUrl, QString> savepath_fromurl;
|
QMap<QUrl, QString> savepath_fromurl;
|
||||||
QHash<QString, QHash<QString, TrackerInfos> > trackersInfos;
|
QHash<QString, QHash<QString, TrackerInfos> > trackersInfos;
|
||||||
|
QStringList torrentsToPausedAfterChecking;
|
||||||
// Ratio
|
// Ratio
|
||||||
QPointer<QTimer> BigRatioTimer;
|
QPointer<QTimer> BigRatioTimer;
|
||||||
// HTTP
|
// HTTP
|
||||||
@@ -180,6 +181,7 @@ public slots:
|
|||||||
void deleteTorrent(QString hash, bool delete_local_files = false);
|
void deleteTorrent(QString hash, bool delete_local_files = false);
|
||||||
void startUpTorrents();
|
void startUpTorrents();
|
||||||
session_proxy asyncDeletion();
|
session_proxy asyncDeletion();
|
||||||
|
void recheckTorrent(QString hash);
|
||||||
/* Needed by Web UI */
|
/* Needed by Web UI */
|
||||||
void pauseAllTorrents();
|
void pauseAllTorrents();
|
||||||
void pauseTorrent(QString hash);
|
void pauseTorrent(QString hash);
|
||||||
|
@@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include "ui_confirmdeletiondlg.h"
|
#include "ui_confirmdeletiondlg.h"
|
||||||
|
#include "misc.h"
|
||||||
|
|
||||||
class DeletionConfirmationDlg : public QDialog, private Ui::confirmDeletionDlg {
|
class DeletionConfirmationDlg : public QDialog, private Ui::confirmDeletionDlg {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -40,6 +41,7 @@ class DeletionConfirmationDlg : public QDialog, private Ui::confirmDeletionDlg {
|
|||||||
public:
|
public:
|
||||||
DeletionConfirmationDlg(QWidget *parent=0): QDialog(parent) {
|
DeletionConfirmationDlg(QWidget *parent=0): QDialog(parent) {
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
move(misc::screenCenter(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool shouldDeleteLocalFiles() const {
|
bool shouldDeleteLocalFiles() const {
|
||||||
|
@@ -56,6 +56,18 @@ void downloadThread::processDlFinished(QNetworkReply* reply) {
|
|||||||
// Failure
|
// Failure
|
||||||
emit downloadFailure(url, errorCodeToString(reply->error()));
|
emit downloadFailure(url, errorCodeToString(reply->error()));
|
||||||
} else {
|
} 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
|
// Success
|
||||||
QString filePath;
|
QString filePath;
|
||||||
QTemporaryFile tmpfile;
|
QTemporaryFile tmpfile;
|
||||||
|
@@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <QHash>
|
||||||
|
|
||||||
class QNetworkAccessManager;
|
class QNetworkAccessManager;
|
||||||
|
|
||||||
@@ -41,6 +42,7 @@ class downloadThread : public QObject {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QNetworkAccessManager *networkManager;
|
QNetworkAccessManager *networkManager;
|
||||||
|
QHash<QString, QString> redirect_mapping;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void downloadFinished(QString url, QString file_path);
|
void downloadFinished(QString url, QString file_path);
|
||||||
|
@@ -154,7 +154,9 @@ signals:
|
|||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void updateCurrentFeed(QTreeWidgetItem* new_item) {
|
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;
|
current_feed = new_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -46,7 +46,7 @@ protected:
|
|||||||
static QString geoipFolder(bool embedded=false) {
|
static QString geoipFolder(bool embedded=false) {
|
||||||
if(embedded)
|
if(embedded)
|
||||||
return ":/geoip/";
|
return ":/geoip/";
|
||||||
return misc::qBittorrentPath()+"geoip"+QDir::separator();
|
return misc::QDesktopServicesDataLocation()+"geoip"+QDir::separator();
|
||||||
#else
|
#else
|
||||||
static QString geoipFolder(bool) {
|
static QString geoipFolder(bool) {
|
||||||
if(QFile::exists("/usr/local/share/GeoIP/GeoIP.dat"))
|
if(QFile::exists("/usr/local/share/GeoIP/GeoIP.dat"))
|
||||||
|
@@ -456,8 +456,8 @@ void HttpConnection::respondCommand(QString command)
|
|||||||
|
|
||||||
void HttpConnection::recheckTorrent(QString hash) {
|
void HttpConnection::recheckTorrent(QString hash) {
|
||||||
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
||||||
if(h.is_valid() && !h.is_paused()){
|
if(h.is_valid()){
|
||||||
h.force_recheck();
|
BTSession->recheckTorrent(h.hash());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -466,7 +466,7 @@ void HttpConnection::recheckAllTorrents() {
|
|||||||
std::vector<torrent_handle>::iterator torrentIT;
|
std::vector<torrent_handle>::iterator torrentIT;
|
||||||
for(torrentIT = torrents.begin(); torrentIT != torrents.end(); torrentIT++) {
|
for(torrentIT = torrents.begin(); torrentIT != torrents.end(); torrentIT++) {
|
||||||
QTorrentHandle h = QTorrentHandle(*torrentIT);
|
QTorrentHandle h = QTorrentHandle(*torrentIT);
|
||||||
if(h.is_valid() && !h.is_paused())
|
if(h.is_valid())
|
||||||
h.force_recheck();
|
BTSession->recheckTorrent(h.hash());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
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.
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
Reference in New Issue
Block a user