Compare commits
117 Commits
release-2.
...
release-2.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
42574242ef | ||
![]() |
d5c174a6f8 | ||
![]() |
173999e504 | ||
![]() |
1ed928bc39 | ||
![]() |
b85d51ba79 | ||
![]() |
779b53722b | ||
![]() |
76780c4c46 | ||
![]() |
da74f24a71 | ||
![]() |
01c56865db | ||
![]() |
b541c9fa4c | ||
![]() |
aac0fbcbe4 | ||
![]() |
b315551edd | ||
![]() |
58a885cb87 | ||
![]() |
d19282285c | ||
![]() |
32a8dec0e7 | ||
![]() |
e0d8ca39a5 | ||
![]() |
2dd5bccd49 | ||
![]() |
ec3169c9b0 | ||
![]() |
18d0283463 | ||
![]() |
7bfd7e9cda | ||
![]() |
459bb8c51d | ||
![]() |
9fe807b6f1 | ||
![]() |
9159a9f25d | ||
![]() |
84f00bf3f6 | ||
![]() |
8ea8f8a9f7 | ||
![]() |
d3687fd863 | ||
![]() |
d1a549a6cc | ||
![]() |
c1552ff254 | ||
![]() |
54a396bc6e | ||
![]() |
ed732bca63 | ||
![]() |
02a4464e8f | ||
![]() |
7f97df4462 | ||
![]() |
9d20af02a2 | ||
![]() |
cbaef050f0 | ||
![]() |
148139c2c4 | ||
![]() |
793f8a103d | ||
![]() |
ffa48b64ac | ||
![]() |
59a8e651f9 | ||
![]() |
fb9f2a01b5 | ||
![]() |
944e25a5d8 | ||
![]() |
ad597c72d2 | ||
![]() |
abbbf1e562 | ||
![]() |
d2dd29c35a | ||
![]() |
906f2bab1e | ||
![]() |
bb6468005d | ||
![]() |
a2423e97eb | ||
![]() |
ed1d75ecb1 | ||
![]() |
1e4200345a | ||
![]() |
be11f4e039 | ||
![]() |
22ec528cdf | ||
![]() |
ebf341a6de | ||
![]() |
68ba6322e1 | ||
![]() |
968a5f3017 | ||
![]() |
8df1708491 | ||
![]() |
da51ce1b71 | ||
![]() |
95a6de9b00 | ||
![]() |
269bbdf01d | ||
![]() |
df03b042d6 | ||
![]() |
3ec118d59b | ||
![]() |
bce575ee68 | ||
![]() |
83da56b0eb | ||
![]() |
fa2891c225 | ||
![]() |
c4bf42524c | ||
![]() |
a096105f18 | ||
![]() |
51f842aaef | ||
![]() |
76c4466fb6 | ||
![]() |
facd02a7ec | ||
![]() |
ed8da2ef66 | ||
![]() |
998352f9f1 | ||
![]() |
8c1a135d16 | ||
![]() |
b976d39207 | ||
![]() |
f0a18ec1f5 | ||
![]() |
f9a5afe446 | ||
![]() |
b13c7abca0 | ||
![]() |
1f104f62f5 | ||
![]() |
f8f7729e77 | ||
![]() |
eca262f5f4 | ||
![]() |
df5f5a943b | ||
![]() |
497cb07852 | ||
![]() |
10ab8f107c | ||
![]() |
3a6ff19418 | ||
![]() |
ab317a3a62 | ||
![]() |
617724c2b1 | ||
![]() |
422c03b4ec | ||
![]() |
4af05dc63c | ||
![]() |
ac92287b43 | ||
![]() |
c7634b3828 | ||
![]() |
5d1d26b285 | ||
![]() |
644fea69a1 | ||
![]() |
4dc8959f67 | ||
![]() |
63be5ffc74 | ||
![]() |
c5a9e27cb3 | ||
![]() |
ecf48b3a7b | ||
![]() |
63e5339690 | ||
![]() |
d8c27ac8c4 | ||
![]() |
925597c43a | ||
![]() |
ba8fd62900 | ||
![]() |
3f61e176f0 | ||
![]() |
542338972a | ||
![]() |
fe91599eb4 | ||
![]() |
d9817795ed | ||
![]() |
6ede368f63 | ||
![]() |
6885f46f4b | ||
![]() |
9323660c79 | ||
![]() |
88b77a63ed | ||
![]() |
4d1ef40f6e | ||
![]() |
9a68e0cc25 | ||
![]() |
396427e3b6 | ||
![]() |
e460f1c365 | ||
![]() |
b9531c8245 | ||
![]() |
27aff04f11 | ||
![]() |
08fe5814c5 | ||
![]() |
5af8b7c0e2 | ||
![]() |
c1acbda38f | ||
![]() |
afa5213c94 | ||
![]() |
17b8ba27b3 | ||
![]() |
3f9b74430a |
14
AUTHORS
@@ -12,11 +12,6 @@ Code from other projects:
|
||||
copyright: Malte Starostik <malte@kde.org>
|
||||
license: LGPL
|
||||
|
||||
GeoIP database author:
|
||||
* files: src/geoip/GeoIP.dat
|
||||
copyright: MaxMind, Inc (http://maxmind.com/)
|
||||
license: Open Data License (see src/geoip/LICENSE.txt)
|
||||
|
||||
Images Authors:
|
||||
* files: src/Icons/*.png
|
||||
copyright: Gnome Icon Theme
|
||||
@@ -72,19 +67,20 @@ Translations authors:
|
||||
- Finnish: Niklas Laxström (nikerabbit@users.sourceforge.net)
|
||||
- French: Christophe Dumez (chris@qbittorrent.org)
|
||||
- German: Niels Hoffmann (zentralmaschine@users.sourceforge.net)
|
||||
- Greek: Tsvetan Bankov (emerge_life@users.sourceforge.net)
|
||||
- Greek: Tsvetan Bankov (emerge_life@users.sourceforge.net) and Stephanos Antaris (santaris@csd.auth.gr)
|
||||
- Hungarian: Majoros Péter (majoros.j.p@t-online.hu)
|
||||
- Italian: Mirko Ferrari (mirkoferrari@gmail.com) and Ferraro Luciano (luciano.ferraro@gmail.com)
|
||||
- Japanese: Nardog (nardog@e2umail.com)
|
||||
- Japanese: Nardog (alphisation@gmail.com)
|
||||
- Korean: Jin Woo Sin (jin828sin@users.sourceforge.net)
|
||||
- Norwegian: Lars-Erik Labori (hamil@users.sourceforge.net)
|
||||
- Polish: Jarek Smieja (ajep9691@wp.pl)
|
||||
- Polish: Mariusz Fik (fisiu@opensuse.org)
|
||||
- Portuguese: Nick Marinho (nickmarinho@gmail.com)
|
||||
- Romanian: Obada Denis (obadadenis@users.sourceforge.net)
|
||||
- Russian: Nick Khazov (m2k3d0n at users.sourceforge.net)
|
||||
- Serbian: Anaximandar Milet (anaximandar at operamail.com)
|
||||
- Slovak: helix84
|
||||
- Spanish: Vicente Raul Plata Fonseca (silverxnt@users.sourceforge.net)
|
||||
- Swedish: Daniel Nylander (po@danielnylander.se)
|
||||
- Turkish: Erdem Bingöl (erdem84@gmail.com)
|
||||
- Turkish: Hasan Yilmaz (iletisim@hedefturkce.com)
|
||||
- Ukrainian: Andrey Shpachenko (masterfix@users.sourceforge.net)
|
||||
license: GPLv2
|
||||
|
72
Changelog
@@ -1,10 +1,26 @@
|
||||
* Unknown - Christophe Dumez <chris@qbittorrent.org> - v2.0.0
|
||||
* Fri Dec 18 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.2
|
||||
- BUGFIX: Fix .qbittorrent folder not being created (critical bug introduced in v2.0.1 that makes qBittorrent unusuable for new users)
|
||||
- BUGFIX: Fix RSS Feed downloader for some feeds
|
||||
- BUGFIX: Do not use home folder as a fallback when the save path is not accessible
|
||||
- BUGFIX: Fix Mininova, ThePirateBay search engine plugins
|
||||
- BUGFIX: Read RSS articles are remembered on restart for feeds with no torrents attached
|
||||
|
||||
* Sun Dec 13 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.1
|
||||
- BUGFIX: µTorrent user-agent is now spoofed correctly
|
||||
- BUGFIX: Fix column hiding behavior when queueing system is disabled
|
||||
- BUGFIX: Fix link to plugins.qbittorrent.org in plugins dialog
|
||||
- BUGFIX: ~/qBT_dir is created only when it is actually used
|
||||
- BUGFIX: Fix possible missing slot message (toggleSelectedTorrentsSuperSeeding)
|
||||
- BUGFIX: Fix possible crash in torrent properties (files)
|
||||
- BUGFIX: Added Hex Magnet Links support (Thanks Haypo)
|
||||
|
||||
* Thu Dec 10 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.0
|
||||
- FEATURE: Added program option to disable splash screen
|
||||
- FEATURE: Dropped dependency on libcurl and libzzip
|
||||
- FEATURE: Display more information regarding the torrent in its properties
|
||||
- FEATURE: Various optimizations to save CPU and memory
|
||||
- FEATURE: Folder scanning now works with CIFS and NFS mounted folders
|
||||
- FEATURE: Speed up qBittorrent startup
|
||||
- FEATURE: Speed up qBittorrent startup and shutdown
|
||||
- FEATURE: Display per-torrent peer list
|
||||
- FEATURE: Make sure torrent files are always sorted by name
|
||||
- FEATURE: Seeds and Peers columns are now sortable
|
||||
@@ -21,6 +37,9 @@
|
||||
- FEATURE: Dropped Qt 4.3 support (Qt >= 4.4 is now required)
|
||||
- FEATURE: Display close tab button into the tabs in search engine (Qt >= 4.5 only)
|
||||
- FEATURE: Show official documentation when pressing F1 key
|
||||
- FEATURE: Search engine plugins now handle HTTP protocol gzip compression
|
||||
- FEATURE: Enabled lazy bitfield as a counter-measure for ISP speed throttling
|
||||
- FEATURE: Fall back to a random port if qBittorrent could not listen on the chosen port
|
||||
- FEATURE: Announce to all trackers specified for a torrent (µTorrent behavior) (libtorrent >= v0.15 only)
|
||||
- FEATURE: Added per-torrent super seeding mode (libtorrent >= v0.15 only)
|
||||
- FEATURE: Support for storing symbolic links in .torrent files (libtorrent >= v0.15 only)
|
||||
@@ -34,10 +53,16 @@
|
||||
- FEATURE: Include DHT traffic in the rate limiter (libtorrent >= v0.15 only)
|
||||
- FEATURE: Support for bitcomet padding files (libtorrent >= v0.15 only)
|
||||
- FEATURE: Option to skip file checking and start seeding immediately in torrent addition dialog (Stephanos Antaris) (libtorrent >= v0.15 only)
|
||||
- BUGFIX: Made sure qBittorrent does not scrape the tracker too frequently (libtorrent >= 0.15 only)
|
||||
- BUGFIX: Fix Paste action in search engine field
|
||||
- BUGFIX: Fix possible double free in search engine destructor
|
||||
- BUGFIX: Properly handle trackers error messages
|
||||
- WEB UI: Remodeled Web UI to match new qBittorrent UI (Properties and preferences available)
|
||||
- WEB UI: Added internationalization support
|
||||
- WEB UI: Reduced computation in Javascript (do this one server side instead)
|
||||
- WEB UI: Fixed Transfer list flickering
|
||||
- WEB UI: Password is now stored as md5
|
||||
- I18N: Added Serbian translation (By Anaximandar Milet)
|
||||
- COSMETIC: Merged download / upload lists
|
||||
- COSMETIC: Torrents can be filtered based on their status
|
||||
- COSMETIC: Torrent properties are now displayed in main window
|
||||
@@ -50,6 +75,49 @@
|
||||
- COSMETIC: New torrent status icons by Mateusz Tolola
|
||||
- COSMETIC: Make use of libnotify if available for system notifications (Ubuntu, ...)
|
||||
|
||||
* Tue Nov 17 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.6
|
||||
- BUGFIX: RSS feed articles can now be displayed using keyboard arrows
|
||||
- BUGFIX: RSS feed downloader can only process unread articles now
|
||||
- BUGFIX: Fixed memory leak in RSS parser
|
||||
- BUGFIX: Fixed possible crash in search autocompletion
|
||||
- BUGFIX: Improved ETA calculation for big torrents
|
||||
- BUGFIX: Fixed per-torrent speed limiting
|
||||
|
||||
* Wed Nov 4 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.5
|
||||
- BUGFIX: Fixed man page
|
||||
- BUGFIX: Fix crash on torrent addition (if libtorrent-rasterbar has debug enabled)
|
||||
- BUGFIX: Fix trackers addition to torrents (bug introduced in v1.5.4)
|
||||
- BUGFIX: Suppress compilation warning regarding sortNewsList() not being used
|
||||
- BUGFIX: Make sure scan folder is different than qBittorrent backup directory to avoid torrents deletion
|
||||
- BUGFIX: Added safety mecanism which adds the torrents back to the list in case qbittorrent-resume.conf gets deleted or corrupted.
|
||||
|
||||
* Sun Oct 25 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.4
|
||||
- BUGFIX: Updated man page
|
||||
- BUGFIX: Fixed possible crash with torrents containing unicode characters
|
||||
- BUGFIX: Fixed problem when disabling systray integration and starting minimized
|
||||
- BUGFIX: Fixed PirateBay search plugin
|
||||
- BUGFIX: Using Download button in search results list now downloads the right torrents
|
||||
- BUGFIX: The search results list is no longer sorted automatically when a row color is updated
|
||||
|
||||
* Wed Sep 30 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.3
|
||||
- BUGFIX: Fix a possible crash when pausing then deleting a torrent quickly
|
||||
- BUGFIX: Fix a race condition in folder scanning and torrent downloader
|
||||
- BUGFIX: Hide download url column in search results
|
||||
- BUGFIX: Fix a crash when scanned directory does not exist
|
||||
- BUGFIX: Fix compilation on Mac OS
|
||||
- BUGFIX: Added a command line parameter to disable splash screen
|
||||
- BUGFIX: Ignore permanent deletion button when no torrent is selected
|
||||
- BUGFIX: When a selected torrent is deleted, select next suitable torrent
|
||||
|
||||
* Sun Sep 20 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.2
|
||||
- BUGFIX: Some torrents were pausing for no reason
|
||||
- I18N: Updated Korean translation
|
||||
|
||||
* Thu Sep 7 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.1
|
||||
- BUGFIX: Fix crash in torrent addition dialog when save path does not exist (closes #425227)
|
||||
- BUGFIX: Fix downloading from URL (broken in v1.5.0)
|
||||
- BUGFIX: Pause torrents in error state
|
||||
|
||||
* Thu Sep 3 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.0
|
||||
- FEATURE: Added Magnet URI support
|
||||
- FEATURE: Search engine supports category-based requests
|
||||
|
5
INSTALL
@@ -18,11 +18,16 @@ Dependencies:
|
||||
- libboost: libboost-filesystem, libboost-date-time, libboost-thread, libboost-serialization
|
||||
|
||||
- python >= 2.3 (needed by search engine)
|
||||
* Run time only dependency
|
||||
|
||||
- libnotify >= 0.4.2, glib-2.0 (optional)
|
||||
* Can be used for system notifications to replace standard Qt notifications
|
||||
so that it integrates better into the Desktop
|
||||
|
||||
- geoip-database (optional)
|
||||
* If qBittorrent cannot find this database, it will try to resolve countries using the Internet but it will be a lot slower.
|
||||
* Run time only dependency
|
||||
|
||||
DOCUMENTATION:
|
||||
Please note that there is a documentation with a "compiling howto" at http://wiki.qbittorrent.org.
|
||||
|
||||
|
55
configure
vendored
@@ -18,8 +18,12 @@ Main options:
|
||||
--help This help text.
|
||||
|
||||
Dependency options:
|
||||
--with-libboost-inc=[path] Path to libboost include files
|
||||
--disable-libnotify Disable use of libnotify
|
||||
--with-libboost-inc=[path] Path to libboost include files
|
||||
--disable-libnotify Disable use of libnotify
|
||||
--disable-geoip-database Disable use of geoip-database
|
||||
--with-geoip-database-embedded Geoip Database will be embedded in
|
||||
qBittorrent executable (please follow
|
||||
instructions in src/geoip/README)
|
||||
|
||||
EOT
|
||||
}
|
||||
@@ -146,6 +150,16 @@ while [ $# -gt 0 ]; do
|
||||
shift
|
||||
;;
|
||||
|
||||
--disable-geoip-database)
|
||||
QC_DISABLE_geoip_database="Y"
|
||||
shift
|
||||
;;
|
||||
|
||||
--with-geoip-database-embedded)
|
||||
QC_WITH_GEOIP_DATABASE_EMBEDDED="Y"
|
||||
shift
|
||||
;;
|
||||
|
||||
--verbose)
|
||||
QC_VERBOSE="Y"
|
||||
shift
|
||||
@@ -169,6 +183,8 @@ echo DATADIR=$DATADIR
|
||||
echo EX_QTDIR=$EX_QTDIR
|
||||
echo QC_WITH_LIBBOOST_INC=$QC_WITH_LIBBOOST_INC
|
||||
echo QC_DISABLE_libnotify=$QC_DISABLE_libnotify
|
||||
echo QC_DISABLE_geoip_database=$QC_DISABLE_geoip_database
|
||||
echo QC_WITH_GEOIP_DATABASE_EMBEDDED=$QC_WITH_GEOIP_DATABASE_EMBEDDED
|
||||
echo
|
||||
fi
|
||||
|
||||
@@ -422,6 +438,36 @@ public:
|
||||
return true;
|
||||
}
|
||||
};
|
||||
#line 1 "geoip-database.qcm"
|
||||
/*
|
||||
-----BEGIN QCMOD-----
|
||||
name: geoip-database
|
||||
arg: with-geoip-database-embedded, Geoip Database will be embedded in qBittorrent executable (please follow instructions in src/geoip/README)
|
||||
-----END QCMOD-----
|
||||
*/
|
||||
// see Conf::findPkgConfig
|
||||
class qc_geoip_database : public ConfObj
|
||||
{
|
||||
public:
|
||||
qc_geoip_database(Conf *c) : ConfObj(c) {}
|
||||
QString name() const { return "GeoIP Database (optional)"; }
|
||||
QString shortname() const { return "GeoIP Database"; }
|
||||
bool exec() {
|
||||
#ifdef Q_WS_X11
|
||||
if(!conf->getenv("QC_WITH_GEOIP_DATABASE_EMBEDDED").isEmpty()) {
|
||||
#endif
|
||||
conf->addDefine("WITH_GEOIP_EMBEDDED");
|
||||
printf(" embedded and");
|
||||
return true;
|
||||
#ifdef Q_WS_X11
|
||||
}
|
||||
if(QFile::exists("/usr/share/GeoIP/GeoIP.dat") || QFile::exists("/usr/local/share/GeoIP/GeoIP.dat") || QFile::exists("/var/lib/GeoIP/GeoIP.dat"))
|
||||
return true;
|
||||
printf("\nWarning: GeoIP database was not found at /usr/share/GeoIP/GeoIP.dat or /var/lib/GeoIP/GeoIP.dat\nCountry resolution will be slow.");
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
EOT
|
||||
cat >$1/modules_new.cpp <<EOT
|
||||
@@ -437,6 +483,9 @@ cat >$1/modules_new.cpp <<EOT
|
||||
o = new qc_libnotify(conf);
|
||||
o->required = false;
|
||||
o->disabled = false;
|
||||
o = new qc_geoip_database(conf);
|
||||
o->required = false;
|
||||
o->disabled = false;
|
||||
|
||||
EOT
|
||||
cat >$1/conf4.h <<EOT
|
||||
@@ -1384,6 +1433,8 @@ export DATADIR
|
||||
export EX_QTDIR
|
||||
export QC_WITH_LIBBOOST_INC
|
||||
export QC_DISABLE_libnotify
|
||||
export QC_DISABLE_geoip_database
|
||||
export QC_WITH_GEOIP_DATABASE_EMBEDDED
|
||||
export QC_VERBOSE
|
||||
rm -rf .qconftemp
|
||||
(
|
||||
|
@@ -14,4 +14,6 @@
|
||||
</dep>
|
||||
<dep type='libnotify'>
|
||||
</dep>
|
||||
<dep type='geoip-database'>
|
||||
</dep>
|
||||
</qconf>
|
||||
|
29
qcm/geoip-database.qcm
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
-----BEGIN QCMOD-----
|
||||
name: geoip-database
|
||||
arg: with-geoip-database-embedded, Geoip Database will be embedded in qBittorrent executable (please follow instructions in src/geoip/README)
|
||||
-----END QCMOD-----
|
||||
*/
|
||||
// see Conf::findPkgConfig
|
||||
class qc_geoip_database : public ConfObj
|
||||
{
|
||||
public:
|
||||
qc_geoip_database(Conf *c) : ConfObj(c) {}
|
||||
QString name() const { return "GeoIP Database (optional)"; }
|
||||
QString shortname() const { return "GeoIP Database"; }
|
||||
bool exec() {
|
||||
#ifdef Q_WS_X11
|
||||
if(!conf->getenv("QC_WITH_GEOIP_DATABASE_EMBEDDED").isEmpty()) {
|
||||
#endif
|
||||
conf->addDefine("WITH_GEOIP_EMBEDDED");
|
||||
printf(" embedded and");
|
||||
return true;
|
||||
#ifdef Q_WS_X11
|
||||
}
|
||||
if(QFile::exists("/usr/share/GeoIP/GeoIP.dat") || QFile::exists("/usr/local/share/GeoIP/GeoIP.dat") || QFile::exists("/var/lib/GeoIP/GeoIP.dat"))
|
||||
return true;
|
||||
printf("\nWarning: GeoIP database was not found at /usr/share/GeoIP/GeoIP.dat or /var/lib/GeoIP/GeoIP.dat\nCountry resolution will be slow.");
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
};
|
34
src/GUI.cpp
@@ -196,17 +196,24 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
||||
GUI::~GUI() {
|
||||
qDebug("GUI destruction");
|
||||
hide();
|
||||
// Async deletion of Bittorrent session as early as possible
|
||||
// in order to speed up exit
|
||||
session_proxy sp = BTSession->asyncDeletion();
|
||||
// Some saving
|
||||
properties->saveSettings();
|
||||
disconnect(tabs, SIGNAL(currentChanged(int)), this, SLOT(tab_changed(int)));
|
||||
// Delete other GUI objects
|
||||
delete status_bar;
|
||||
delete transferList;
|
||||
delete guiUpdater;
|
||||
|
||||
if(rssWidget)
|
||||
delete rssWidget;
|
||||
delete searchEngine;
|
||||
delete transferListFilters;
|
||||
delete properties;
|
||||
delete transferList;
|
||||
delete hSplitter;
|
||||
delete vSplitter;
|
||||
delete guiUpdater;
|
||||
qDebug("1");
|
||||
if(systrayCreator) {
|
||||
delete systrayCreator;
|
||||
}
|
||||
@@ -214,19 +221,21 @@ GUI::~GUI() {
|
||||
delete systrayIcon;
|
||||
delete myTrayIconMenu;
|
||||
}
|
||||
qDebug("2");
|
||||
localServer->close();
|
||||
delete localServer;
|
||||
delete tabs;
|
||||
qDebug("3");
|
||||
// Keyboard shortcuts
|
||||
delete switchSearchShortcut;
|
||||
delete switchSearchShortcut2;
|
||||
delete switchTransferShortcut;
|
||||
delete switchRSSShortcut;
|
||||
qDebug("4");
|
||||
// Delete BTSession objects
|
||||
delete BTSession;
|
||||
qDebug("5");
|
||||
// May freeze for a few seconds after the next line
|
||||
// because the Bittorrent session proxy will
|
||||
// actually be deleted now and destruction
|
||||
// becomes synchronous
|
||||
qDebug("Exiting GUI destructor...");
|
||||
}
|
||||
|
||||
void GUI::displayRSSTab(bool enable) {
|
||||
@@ -740,7 +749,7 @@ void GUI::loadPreferences(bool configure_session) {
|
||||
// RSS
|
||||
if(Preferences::isRSSEnabled()) {
|
||||
displayRSSTab(true);
|
||||
rssWidget->updateRefreshInterval(Preferences::getRefreshInterval());
|
||||
rssWidget->updateRefreshInterval(Preferences::getRSSRefreshInterval());
|
||||
} else {
|
||||
displayRSSTab(false);
|
||||
}
|
||||
@@ -803,11 +812,12 @@ void GUI::showNotificationBaloon(QString title, QString msg) const {
|
||||
if (notify_init ("summary-body")) {
|
||||
NotifyNotification* notification;
|
||||
notification = notify_notification_new (title.toLocal8Bit().data(), msg.toLocal8Bit().data(), "qbittorrent", 0);
|
||||
GError* error = 0;
|
||||
gboolean success = notify_notification_show (notification, &error);
|
||||
gboolean success = notify_notification_show (notification, NULL);
|
||||
g_object_unref(G_OBJECT(notification));
|
||||
notify_uninit ();
|
||||
if(success)
|
||||
if(success) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if(systrayIcon)
|
||||
@@ -903,6 +913,6 @@ void GUI::on_actionOptions_triggered() {
|
||||
// an url
|
||||
void GUI::on_actionDownload_from_URL_triggered() {
|
||||
downloadFromURL *downloadFromURLDialog = new downloadFromURL(this);
|
||||
connect(downloadFromURLDialog, SIGNAL(urlsReadyToBeDownloaded(const QStringList&)), BTSession, SLOT(downloadFromURLList(const QStringList&)));
|
||||
connect(downloadFromURLDialog, SIGNAL(urlsReadyToBeDownloaded(const QStringList&)), this, SLOT(downloadFromURLList(const QStringList&)));
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 185 B After Width: | Height: | Size: 459 B |
Before Width: | Height: | Size: 743 B |
Before Width: | Height: | Size: 659 B |
@@ -1,6 +1,6 @@
|
||||
[Desktop Entry]
|
||||
Categories=Qt;Network;P2P;
|
||||
Comment=V2.0.0
|
||||
Comment=V2.0.2
|
||||
Exec=qbittorrent %f
|
||||
GenericName=Bittorrent client
|
||||
GenericName[bg]=Торент клиент
|
||||
@@ -21,6 +21,7 @@ GenericName[pt_BR]=Cliente Bittorrent
|
||||
GenericName[ro]=Client Bittorrent
|
||||
GenericName[ru]=клиент Bittorrent
|
||||
GenericName[sk]=Klient siete Bittorrent
|
||||
GenericName[sr]=Bittorrent-клијент
|
||||
GenericName[sv]=Bittorrent-klient
|
||||
GenericName[tr]=Bittorrent istemcisi
|
||||
GenericName[uk]=Bittorrent-клієнт
|
||||
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.1 KiB |
@@ -75,13 +75,14 @@ class about : public QDialog, private Ui::AboutDlg{
|
||||
- <u>Greek:</u> Tsvetan Bankov (emerge_life@users.sourceforge.net)<br>\
|
||||
- <u>Hungarian:</u> Majoros Péter (majoros.peterj@gmail.com)<br>\
|
||||
- <u>Italian:</u> Mirko Ferrari (mirkoferrari@gmail.com) and Ferraro Luciano (luciano.ferraro@gmail.com)<br>\
|
||||
- <u>Japanese:</u> Nardog (nardog@e2umail.com)<br>\
|
||||
- <u>Japanese:</u> Nardog (alphisation@gmail.com)<br>\
|
||||
- <u>Korean:</u> Jin Woo Sin (jin828sin@users.sourceforge.net)<br>\
|
||||
- <u>Norwegian:</u> Lars-Erik Labori (hamil@users.sourceforge.net)<br>\
|
||||
- <u>Polish:</u> Jarek Smieja (ajep9691@wp.pl)<br>\
|
||||
- <u>Polish:</u> Mariusz Fik (fisiu@opensuse.org)<br>\
|
||||
- <u>Portuguese:</u> Nick Marinho (nickmarinho@gmail.com)<br>\
|
||||
- <u>Romanian:</u> Obada Denis (obadadenis@users.sourceforge.net)<br>\
|
||||
- <u>Russian:</u> Nick Khazov (m2k3d0n@users.sourceforge.net) and Alexey Morsov (samurai@ricom.ru)<br>\
|
||||
- <u>Serbian:</u> Anaximandar Milet (anaximandar@operamail.com)<br>\
|
||||
- <u>Slovak:</u> helix84<br>\
|
||||
- <u>Spanish:</u> Vicente Raul Plata Fonseca (silverxnt@users.sourceforge.net) and Gabriel de Oliveira (deadloop@hotmail.com)<br>\
|
||||
- <u>Swedish:</u> Daniel Nylander (po@danielnylander.se)<br>\
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include <QString>
|
||||
#include <QTimer>
|
||||
#include <QSettings>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "filesystemwatcher.h"
|
||||
#include "bittorrent.h"
|
||||
@@ -62,7 +63,7 @@
|
||||
enum ProxyType {HTTP=1, SOCKS5=2, HTTP_PW=3, SOCKS5_PW=4};
|
||||
|
||||
// Main constructor
|
||||
Bittorrent::Bittorrent() : preAllocateAll(false), addInPause(false), ratio_limit(-1), UPnPEnabled(false), NATPMPEnabled(false), LSDEnabled(false), DHTEnabled(false), queueingEnabled(false), geoipDBLoaded(false) {
|
||||
Bittorrent::Bittorrent() : preAllocateAll(false), addInPause(false), ratio_limit(-1), UPnPEnabled(false), NATPMPEnabled(false), LSDEnabled(false), DHTEnabled(false), queueingEnabled(false), geoipDBLoaded(false), exiting(false) {
|
||||
resolve_countries = false;
|
||||
// To avoid some exceptions
|
||||
fs::path::default_name_check(fs::no_check);
|
||||
@@ -101,13 +102,32 @@ Bittorrent::Bittorrent() : preAllocateAll(false), addInPause(false), ratio_limit
|
||||
qDebug("* BTSession constructed");
|
||||
}
|
||||
|
||||
// Main destructor
|
||||
Bittorrent::~Bittorrent() {
|
||||
qDebug("BTSession deletion");
|
||||
session_proxy Bittorrent::asyncDeletion() {
|
||||
qDebug("Bittorrent session async deletion IN");
|
||||
exiting = true;
|
||||
// Do some BT related saving
|
||||
saveDHTEntry();
|
||||
saveSessionState();
|
||||
saveFastResumeData();
|
||||
// Delete session
|
||||
session_proxy sp = s->abort();
|
||||
delete s;
|
||||
qDebug("Bittorrent session async deletion OUT");
|
||||
return sp;
|
||||
}
|
||||
|
||||
// Main destructor
|
||||
Bittorrent::~Bittorrent() {
|
||||
qDebug("BTSession destructor IN");
|
||||
if(!exiting) {
|
||||
// Do some BT related saving
|
||||
saveDHTEntry();
|
||||
saveSessionState();
|
||||
saveFastResumeData();
|
||||
// Delete session
|
||||
session_proxy sp = s->abort();
|
||||
delete s;
|
||||
}
|
||||
// Disable directory scanning
|
||||
disableDirectoryScanning();
|
||||
// Delete our objects
|
||||
@@ -125,10 +145,7 @@ Bittorrent::~Bittorrent() {
|
||||
delete httpServer;
|
||||
if(timerETA)
|
||||
delete timerETA;
|
||||
// Delete BT session
|
||||
qDebug("Deleting session");
|
||||
delete s;
|
||||
qDebug("Session deleted");
|
||||
qDebug("BTSession destructor OUT");
|
||||
}
|
||||
|
||||
void Bittorrent::preAllocateAllFiles(bool b) {
|
||||
@@ -181,11 +198,12 @@ void Bittorrent::setUploadLimit(QString hash, long val) {
|
||||
void Bittorrent::handleDownloadFailure(QString url, QString reason) {
|
||||
emit downloadFromUrlFailure(url, reason);
|
||||
// Clean up
|
||||
int index = url_skippingDlg.indexOf(url);
|
||||
QUrl qurl = QUrl::fromEncoded(url.toLocal8Bit());
|
||||
int index = url_skippingDlg.indexOf(qurl);
|
||||
if(index >= 0)
|
||||
url_skippingDlg.removeAt(index);
|
||||
if(savepath_fromurl.contains(url))
|
||||
savepath_fromurl.remove(url);
|
||||
if(savepath_fromurl.contains(qurl))
|
||||
savepath_fromurl.remove(qurl);
|
||||
}
|
||||
|
||||
void Bittorrent::startTorrentsInPause(bool b) {
|
||||
@@ -285,15 +303,21 @@ void Bittorrent::configureSession() {
|
||||
// * Session settings
|
||||
session_settings sessionSettings;
|
||||
if(Preferences::isUtorrentSpoofingEnabled()) {
|
||||
sessionSettings.user_agent = "uTorrent/1850";
|
||||
sessionSettings.user_agent = "uTorrent/1850(17414)";
|
||||
} else {
|
||||
sessionSettings.user_agent = "qBittorrent "VERSION;
|
||||
}
|
||||
sessionSettings.upnp_ignore_nonrouters = true;
|
||||
sessionSettings.use_dht_as_fallback = false;
|
||||
// To prevent ISPs from blocking seeding
|
||||
sessionSettings.lazy_bitfields = true;
|
||||
// Speed up exit
|
||||
sessionSettings.stop_tracker_timeout = 1;
|
||||
//sessionSettings.announce_to_all_trackers = true;
|
||||
sessionSettings.auto_scrape_interval = 1200; // 20 minutes
|
||||
#ifdef LIBTORRENT_0_15
|
||||
sessionSettings.announce_to_all_tiers = true; //uTorrent behavior
|
||||
sessionSettings.auto_scrape_min_interval = 900; // 15 minutes
|
||||
#endif
|
||||
// To keep same behavior as in qBittorrent v1.2.0
|
||||
sessionSettings.rate_limit_ip_overhead = false;
|
||||
@@ -819,9 +843,9 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
|
||||
}
|
||||
}
|
||||
QString savePath;
|
||||
if(!from_url.isEmpty() && savepath_fromurl.contains(from_url)) {
|
||||
if(!from_url.isEmpty() && savepath_fromurl.contains(QUrl::fromEncoded(from_url.toLocal8Bit()))) {
|
||||
// Enforcing the save path defined before URL download (from RSS for example)
|
||||
savePath = savepath_fromurl.take(from_url);
|
||||
savePath = savepath_fromurl.take(QUrl::fromEncoded(from_url.toLocal8Bit()));
|
||||
} else {
|
||||
savePath = getSavePath(hash);
|
||||
}
|
||||
@@ -869,12 +893,7 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
|
||||
if(!from_url.isNull()) QFile::remove(file);
|
||||
return h;
|
||||
}
|
||||
// FIXME: Remove this debug
|
||||
std::vector<announce_entry> trackers = h.trackers();
|
||||
std::vector<announce_entry>::iterator it;
|
||||
for(it=trackers.begin(); it!=trackers.end(); it++) {
|
||||
qDebug("* Tracker: %s", it->url.c_str());
|
||||
}
|
||||
|
||||
// Connections limit per torrent
|
||||
h.set_max_connections(Preferences::getMaxConnecsPerTorrent());
|
||||
// Uploads limit per torrent
|
||||
@@ -886,6 +905,7 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
|
||||
// Sequential download
|
||||
if(TorrentTempData::hasTempData(hash)) {
|
||||
qDebug("addTorrent: Setting download as sequential (from tmp data)");
|
||||
h.prioritize_files(TorrentTempData::getFilesPriority(hash));
|
||||
h.set_sequential_download(TorrentTempData::isSequential(hash));
|
||||
}
|
||||
// Save persistent data for new torrent
|
||||
@@ -1122,8 +1142,10 @@ void Bittorrent::saveFastResumeData() {
|
||||
if (rda) {
|
||||
--num_resume_data;
|
||||
s->pop_alert();
|
||||
// Remove torrent from session
|
||||
s->remove_torrent(rda->handle);
|
||||
try {
|
||||
// Remove torrent from session
|
||||
s->remove_torrent(rda->handle);
|
||||
}catch(libtorrent::libtorrent_exception){}
|
||||
continue;
|
||||
}
|
||||
save_resume_data_alert const* rd = dynamic_cast<save_resume_data_alert const*>(a);
|
||||
@@ -1159,14 +1181,14 @@ QStringList Bittorrent::getPeerBanMessages() const {
|
||||
|
||||
void Bittorrent::addConsoleMessage(QString msg, QColor color) {
|
||||
if(consoleMessages.size() > 100) {
|
||||
consoleMessages.removeFirst();
|
||||
consoleMessages.removeFirst();
|
||||
}
|
||||
consoleMessages.append(QString::fromUtf8("<font color='grey'>")+ QDateTime::currentDateTime().toString(QString::fromUtf8("dd/MM/yyyy hh:mm:ss")) + QString::fromUtf8("</font> - <font color='") + color.name() +QString::fromUtf8("'><i>") + msg + QString::fromUtf8("</i></font>"));
|
||||
}
|
||||
|
||||
void Bittorrent::addPeerBanMessage(QString ip, bool from_ipfilter) {
|
||||
if(peerBanMessages.size() > 100) {
|
||||
peerBanMessages.removeFirst();
|
||||
peerBanMessages.removeFirst();
|
||||
}
|
||||
if(from_ipfilter)
|
||||
peerBanMessages.append(QString::fromUtf8("<font color='grey'>")+ QDateTime::currentDateTime().toString(QString::fromUtf8("dd/MM/yyyy hh:mm:ss")) + QString::fromUtf8("</font> - ")+tr("<font color='red'>%1</font> <i>was blocked due to your IP filter</i>", "x.y.z.w was blocked").arg(ip));
|
||||
@@ -1490,9 +1512,16 @@ void Bittorrent::readAlerts() {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (dynamic_cast<listen_failed_alert*>(a.get())) {
|
||||
else if (listen_failed_alert* p = dynamic_cast<listen_failed_alert*>(a.get())) {
|
||||
// Level: fatal
|
||||
addConsoleMessage(tr("Couldn't listen on any of the given ports."), QString::fromUtf8("red"));
|
||||
int tried_port = p->endpoint.port();
|
||||
srand(time(0));
|
||||
int fallback_port = tried_port;
|
||||
do {
|
||||
fallback_port = rand() % 64512 + 1024;
|
||||
} while(fallback_port == tried_port);
|
||||
addConsoleMessage(tr("Couldn't listen on port %1, using %2 instead.").arg(QString::number(tried_port)).arg(QString::number(fallback_port)), QString::fromUtf8("red"));
|
||||
setListeningPort(fallback_port);
|
||||
//emit portListeningFailure();
|
||||
}
|
||||
/*else if (torrent_paused_alert* p = dynamic_cast<torrent_paused_alert*>(a.get())) {
|
||||
@@ -1513,7 +1542,7 @@ void Bittorrent::readAlerts() {
|
||||
QHash<QString, TrackerInfos> trackers_data = trackersInfos.value(h.hash(), QHash<QString, TrackerInfos>());
|
||||
TrackerInfos data = trackers_data.value(tracker_url, TrackerInfos(tracker_url));
|
||||
data.last_message = misc::toQString(p->msg);
|
||||
#ifndef LIBTORRENT_0_15
|
||||
#ifndef LIBTORRENT_0_15
|
||||
data.verified = false;
|
||||
++data.fail_count;
|
||||
#endif
|
||||
@@ -1642,7 +1671,7 @@ QString Bittorrent::getSavePath(QString hash) {
|
||||
if(!saveDir.mkpath(saveDir.path())) {
|
||||
std::cerr << "Couldn't create the save directory: " << saveDir.path().toLocal8Bit().data() << "\n";
|
||||
// XXX: handle this better
|
||||
return QDir::homePath();
|
||||
//return QDir::homePath();
|
||||
}
|
||||
}
|
||||
return savePath;
|
||||
@@ -1670,16 +1699,17 @@ void Bittorrent::addMagnetSkipAddDlg(QString uri) {
|
||||
|
||||
void Bittorrent::downloadUrlAndSkipDialog(QString url, QString save_path) {
|
||||
//emit aboutToDownloadFromUrl(url);
|
||||
QUrl qurl = QUrl::fromEncoded(url.toLocal8Bit());
|
||||
if(!save_path.isEmpty())
|
||||
savepath_fromurl[url] = save_path;
|
||||
url_skippingDlg << url;
|
||||
savepath_fromurl[qurl] = save_path;
|
||||
url_skippingDlg << qurl;
|
||||
// Launch downloader thread
|
||||
downloader->downloadUrl(url);
|
||||
}
|
||||
|
||||
// Add to Bittorrent session the downloaded torrent file
|
||||
void Bittorrent::processDownloadedFile(QString url, QString file_path) {
|
||||
int index = url_skippingDlg.indexOf(url);
|
||||
int index = url_skippingDlg.indexOf(QUrl::fromEncoded(url.toLocal8Bit()));
|
||||
if(index < 0) {
|
||||
// Add file to torrent download list
|
||||
emit newDownloadedTorrent(file_path, url);
|
||||
|
@@ -31,6 +31,8 @@
|
||||
#define __BITTORRENT_H__
|
||||
|
||||
#include <QHash>
|
||||
#include <QMap>
|
||||
#include <QUrl>
|
||||
#include <QStringList>
|
||||
#include <QApplication>
|
||||
#include <QPalette>
|
||||
@@ -86,7 +88,7 @@ private:
|
||||
// Bittorrent
|
||||
session *s;
|
||||
QPointer<QTimer> timerAlerts;
|
||||
QHash<QString, QString> savepath_fromurl;
|
||||
QMap<QUrl, QString> savepath_fromurl;
|
||||
QHash<QString, QHash<QString, TrackerInfos> > trackersInfos;
|
||||
// Ratio
|
||||
QPointer<QTimer> BigRatioTimer;
|
||||
@@ -119,7 +121,9 @@ private:
|
||||
QString filterPath;
|
||||
// Web UI
|
||||
QPointer<HttpServer> httpServer;
|
||||
QStringList url_skippingDlg;
|
||||
QList<QUrl> url_skippingDlg;
|
||||
// Fast exit (async)
|
||||
bool exiting;
|
||||
|
||||
protected:
|
||||
QString getSavePath(QString hash);
|
||||
@@ -163,6 +167,7 @@ public slots:
|
||||
void downloadFromUrl(QString url);
|
||||
void deleteTorrent(QString hash, bool delete_local_files = false);
|
||||
void startUpTorrents();
|
||||
session_proxy asyncDeletion();
|
||||
/* Needed by Web UI */
|
||||
void pauseAllTorrents();
|
||||
void pauseTorrent(QString hash);
|
||||
|
@@ -46,6 +46,7 @@
|
||||
#include <libtorrent/file_pool.hpp>
|
||||
#include <libtorrent/create_torrent.hpp>
|
||||
|
||||
#include "torrentpersistentdata.h"
|
||||
#include "createtorrent_imp.h"
|
||||
#include "misc.h"
|
||||
|
||||
@@ -56,9 +57,9 @@ using namespace boost::filesystem;
|
||||
// name starts with a .
|
||||
bool file_filter(boost::filesystem::path const& filename)
|
||||
{
|
||||
if (filename.leaf()[0] == '.') return false;
|
||||
std::cerr << filename << std::endl;
|
||||
return true;
|
||||
if (filename.leaf()[0] == '.') return false;
|
||||
std::cerr << filename << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
createtorrent::createtorrent(QWidget *parent): QDialog(parent){
|
||||
@@ -98,30 +99,30 @@ void createtorrent::on_removeTracker_button_clicked() {
|
||||
|
||||
int createtorrent::getPieceSize() const {
|
||||
switch(comboPieceSize->currentIndex()) {
|
||||
case 0:
|
||||
return 32*1024;
|
||||
case 1:
|
||||
return 64*1024;
|
||||
case 2:
|
||||
return 128*1024;
|
||||
case 3:
|
||||
return 256*1024;
|
||||
case 4:
|
||||
return 512*1024;
|
||||
case 5:
|
||||
return 1024*1024;
|
||||
case 6:
|
||||
return 2048*1024;
|
||||
default:
|
||||
return 256*1024;
|
||||
case 0:
|
||||
return 32*1024;
|
||||
case 1:
|
||||
return 64*1024;
|
||||
case 2:
|
||||
return 128*1024;
|
||||
case 3:
|
||||
return 256*1024;
|
||||
case 4:
|
||||
return 512*1024;
|
||||
case 5:
|
||||
return 1024*1024;
|
||||
case 6:
|
||||
return 2048*1024;
|
||||
default:
|
||||
return 256*1024;
|
||||
}
|
||||
}
|
||||
|
||||
void createtorrent::on_addTracker_button_clicked() {
|
||||
bool ok;
|
||||
QString URL = QInputDialog::getText(this, tr("Please type an announce URL"),
|
||||
tr("Announce URL:", "Tracker URL"), QLineEdit::Normal,
|
||||
"http://", &ok);
|
||||
tr("Announce URL:", "Tracker URL"), QLineEdit::Normal,
|
||||
"http://", &ok);
|
||||
if(ok){
|
||||
if(trackers_list->findItems(URL, Qt::MatchFixedString).size() == 0)
|
||||
trackers_list->addItem(URL);
|
||||
@@ -139,8 +140,8 @@ void createtorrent::on_removeURLSeed_button_clicked(){
|
||||
void createtorrent::on_addURLSeed_button_clicked(){
|
||||
bool ok;
|
||||
QString URL = QInputDialog::getText(this, tr("Please type a web seed url"),
|
||||
tr("Web seed URL:"), QLineEdit::Normal,
|
||||
"http://", &ok);
|
||||
tr("Web seed URL:"), QLineEdit::Normal,
|
||||
"http://", &ok);
|
||||
if(ok){
|
||||
if(URLSeeds_list->findItems(URL, Qt::MatchFixedString).size() == 0)
|
||||
URLSeeds_list->addItem(URL);
|
||||
@@ -187,24 +188,25 @@ void createtorrent::handleCreationFailure(QString msg) {
|
||||
}
|
||||
|
||||
void createtorrent::handleCreationSuccess(QString path, const char* branch_path) {
|
||||
if(checkStartSeeding->isChecked()) {
|
||||
// Create save path file
|
||||
boost::intrusive_ptr<torrent_info> t;
|
||||
try {
|
||||
t = new torrent_info(path.toLocal8Bit().data());
|
||||
} catch(std::exception&) {
|
||||
QMessageBox::critical(0, tr("Torrent creation"), tr("Created torrent file is invalid. It won't be added to download list."));
|
||||
return;
|
||||
}
|
||||
QString hash = misc::toQString(t->info_hash());
|
||||
QFile savepath_file(misc::qBittorrentPath()+QString::fromUtf8("BT_backup")+QDir::separator()+hash+QString::fromUtf8(".savepath"));
|
||||
savepath_file.open(QIODevice::WriteOnly | QIODevice::Text);
|
||||
savepath_file.write(branch_path);
|
||||
savepath_file.close();
|
||||
emit torrent_to_seed(path);
|
||||
if(checkStartSeeding->isChecked()) {
|
||||
// Create save path temp data
|
||||
boost::intrusive_ptr<torrent_info> t;
|
||||
try {
|
||||
t = new torrent_info(path.toLocal8Bit().data());
|
||||
} catch(std::exception&) {
|
||||
QMessageBox::critical(0, tr("Torrent creation"), tr("Created torrent file is invalid. It won't be added to download list."));
|
||||
return;
|
||||
}
|
||||
QMessageBox::information(0, tr("Torrent creation"), tr("Torrent was created successfully:")+" "+path);
|
||||
close();
|
||||
QString hash = misc::toQString(t->info_hash());
|
||||
TorrentTempData::setSavePath(hash, QString(branch_path));
|
||||
#ifdef LIBTORRENT_0_15
|
||||
// Enable seeding mode (do not recheck the files)
|
||||
TorrentTempData::setSeedingMode(hash, true);
|
||||
#endif
|
||||
emit torrent_to_seed(path);
|
||||
}
|
||||
QMessageBox::information(0, tr("Torrent creation"), tr("Torrent was created successfully:")+" "+path);
|
||||
close();
|
||||
}
|
||||
|
||||
void createtorrent::updateProgressBar(int progress) {
|
||||
@@ -228,7 +230,7 @@ void torrentCreatorThread::create(QString _input_path, QString _save_path, QStri
|
||||
}
|
||||
|
||||
void sendProgressUpdateSignal(int i, int num, torrentCreatorThread *parent){
|
||||
parent->sendProgressSignal((int)(i*100./(float)num));
|
||||
parent->sendProgressSignal((int)(i*100./(float)num));
|
||||
}
|
||||
|
||||
void torrentCreatorThread::sendProgressSignal(int progress) {
|
||||
|
@@ -84,7 +84,13 @@ void downloadThread::downloadUrl(QString url){
|
||||
// Update proxy settings
|
||||
applyProxySettings();
|
||||
// Process download request
|
||||
networkManager->get(QNetworkRequest(QUrl(url)));
|
||||
QNetworkRequest request;
|
||||
request.setUrl(QUrl::fromEncoded(url.toLocal8Bit()));
|
||||
// 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");
|
||||
qDebug("Downloading %s...", request.url().toString().toLocal8Bit().data());
|
||||
networkManager->get(request);
|
||||
}
|
||||
|
||||
void downloadThread::applyProxySettings() {
|
||||
|
@@ -94,7 +94,7 @@ QList<QVariantMap> EventManager::getPropTrackersInfo(QString hash) const {
|
||||
QList<QVariantMap> EventManager::getPropFilesInfo(QString hash) const {
|
||||
QList<QVariantMap> files;
|
||||
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
||||
if(!h.is_valid()) return files;
|
||||
if(!h.is_valid() || !h.has_metadata()) return files;
|
||||
std::vector<int> priorities = h.file_priorities();
|
||||
std::vector<size_type> fp;
|
||||
h.file_progress(fp);
|
||||
@@ -111,7 +111,10 @@ QList<QVariantMap> EventManager::getPropFilesInfo(QString hash) const {
|
||||
file["name"] = name;
|
||||
}
|
||||
file["size"] = misc::friendlyUnit((double)fi->size);
|
||||
file["progress"] = fp[i]/(double)fi->size;
|
||||
if(fi->size > 0)
|
||||
file["progress"] = fp[i]/(double)fi->size;
|
||||
else
|
||||
file["progress"] = 1.; // Empty file...
|
||||
file["priority"] = priorities[i];
|
||||
files << file;
|
||||
++i;
|
||||
@@ -133,7 +136,7 @@ QVariantMap EventManager::getGlobalPreferences() const {
|
||||
QVariantMap EventManager::getPropGeneralInfo(QString hash) const {
|
||||
QVariantMap data;
|
||||
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
||||
if(h.is_valid()) {
|
||||
if(h.is_valid() && h.has_metadata()) {
|
||||
// Save path
|
||||
data["save_path"] = TorrentPersistentData::getSavePath(hash);
|
||||
// Creation date
|
||||
@@ -158,19 +161,11 @@ QVariantMap EventManager::getPropGeneralInfo(QString hash) const {
|
||||
data["time_elapsed"] = elapsed_txt;
|
||||
data["nb_connections"] = QString::number(h.num_connections())+" ("+tr("%1 max", "e.g. 10 max").arg(QString::number(h.connections_limit()))+")";
|
||||
// Update ratio info
|
||||
float ratio;
|
||||
if(h.total_payload_download() == 0){
|
||||
if(h.total_payload_upload() == 0)
|
||||
ratio = 1.;
|
||||
double ratio = BTSession->getRealRatio(h.hash());
|
||||
if(ratio > 100.)
|
||||
data["share_ratio"] = QString::fromUtf8("∞");
|
||||
else
|
||||
ratio = 10.; // Max ratio
|
||||
}else{
|
||||
ratio = (double)h.total_payload_upload()/(double)h.total_payload_download();
|
||||
if(ratio > 10.){
|
||||
ratio = 10.;
|
||||
}
|
||||
}
|
||||
data["share_ratio"] = QString(QByteArray::number(ratio, 'f', 1));
|
||||
data["share_ratio"] = QString(QByteArray::number(ratio, 'f', 1));
|
||||
}
|
||||
return data;
|
||||
}
|
||||
@@ -207,7 +202,7 @@ void EventManager::modifiedTorrent(QTorrentHandle h)
|
||||
case torrent_status::finished:
|
||||
case torrent_status::seeding:
|
||||
if(h.upload_payload_rate() > 0) {
|
||||
event["state"] = QVariant("seeding");
|
||||
event["state"] = QVariant("uploading");
|
||||
} else {
|
||||
event["state"] = QVariant("stalledUP");
|
||||
}
|
||||
@@ -260,7 +255,7 @@ void EventManager::modifiedTorrent(QTorrentHandle h)
|
||||
event["seed"] = QVariant(h.is_seed());
|
||||
double ratio = BTSession->getRealRatio(hash);
|
||||
if(ratio > 100.)
|
||||
QString::fromUtf8("∞");
|
||||
event["ratio"] = QString::fromUtf8("∞");
|
||||
else
|
||||
event["ratio"] = QVariant(QString::number(ratio, 'f', 1));
|
||||
event["hash"] = QVariant(hash);
|
||||
|
@@ -36,6 +36,10 @@ public:
|
||||
setCurrentItem(unread_item);
|
||||
}
|
||||
|
||||
~FeedList() {
|
||||
delete unread_item;
|
||||
}
|
||||
|
||||
void itemAdded(QTreeWidgetItem *item, RssFile* file) {
|
||||
mapping[item] = file;
|
||||
if(file->getType() == RssFile::STREAM) {
|
||||
@@ -65,7 +69,7 @@ public:
|
||||
QStringList path;
|
||||
if(item) {
|
||||
if(item->parent())
|
||||
path.append(getItemPath(item->parent()));
|
||||
path << getItemPath(item->parent());
|
||||
path.append(getRSSItem(item)->getID());
|
||||
}
|
||||
return path;
|
||||
@@ -87,7 +91,7 @@ public:
|
||||
if(getItemType(item) == RssFile::FOLDER && item->isExpanded()) {
|
||||
QList<QTreeWidgetItem*> open_subfolders = getAllOpenFolders(item);
|
||||
if(!open_subfolders.empty()) {
|
||||
open_folders.append(open_subfolders);
|
||||
open_folders << open_subfolders;
|
||||
} else {
|
||||
open_folders << item;
|
||||
}
|
||||
@@ -104,7 +108,7 @@ public:
|
||||
if(getItemType(item) == RssFile::STREAM) {
|
||||
feeds << item;
|
||||
} else {
|
||||
feeds.append(getAllFeedItems(item));
|
||||
feeds << getAllFeedItems(item);
|
||||
}
|
||||
}
|
||||
return feeds;
|
||||
|
@@ -32,7 +32,6 @@
|
||||
#define FEEDDOWNLOADER_H
|
||||
|
||||
#include <QString>
|
||||
#include <QHash>
|
||||
#include <QSettings>
|
||||
#include <QListWidget>
|
||||
#include <QListWidgetItem>
|
||||
@@ -47,6 +46,14 @@
|
||||
#include "bittorrent.h"
|
||||
#include "ui_feeddownloader.h"
|
||||
|
||||
#ifdef QT_4_5
|
||||
#include <QHash>
|
||||
#else
|
||||
#include <QMap>
|
||||
#define QHash QMap
|
||||
#define toHash toMap
|
||||
#endif
|
||||
|
||||
class FeedFilter: public QHash<QString, QVariant> {
|
||||
private:
|
||||
bool valid;
|
||||
@@ -280,6 +287,17 @@ protected slots:
|
||||
}
|
||||
}
|
||||
|
||||
void on_browse_button_clicked() {
|
||||
QString default_path = savepath_line->text();
|
||||
if(default_path.isEmpty() || !QDir(default_path).exists()) {
|
||||
default_path = QDir::homePath();
|
||||
}
|
||||
QString dir = QFileDialog::getExistingDirectory(this, tr("Choose save path"), QDir::homePath());
|
||||
if(!dir.isNull() and QDir(dir).exists()) {
|
||||
savepath_line->setText(dir);
|
||||
}
|
||||
}
|
||||
|
||||
void fillFiltersList() {
|
||||
// Fill filter list
|
||||
foreach(QString filter_name, filters.names()) {
|
||||
@@ -427,7 +445,11 @@ protected slots:
|
||||
}
|
||||
|
||||
void on_testButton_clicked(bool) {
|
||||
if(selected_filter.isEmpty()) return;
|
||||
test_res_lbl->clear();
|
||||
if(selected_filter.isEmpty()) {
|
||||
qDebug("No filter is selected!!!");
|
||||
return;
|
||||
}
|
||||
QString s = test_line->text().trimmed();
|
||||
if(s.isEmpty()) {
|
||||
QMessageBox::warning(0, tr("Filter testing error"), tr("Please specify a test torrent name."));
|
||||
@@ -477,4 +499,7 @@ protected slots:
|
||||
|
||||
};
|
||||
|
||||
#undef QHash
|
||||
#undef toHash
|
||||
|
||||
#endif // FEEDDOWNLOADER_H
|
||||
|
45
src/geoip.h
@@ -40,43 +40,30 @@
|
||||
|
||||
using namespace libtorrent;
|
||||
|
||||
// TODO: Update from Internet
|
||||
class GeoIP {
|
||||
protected:
|
||||
#ifdef WITH_GEOIP_EMBEDDED
|
||||
static QString geoipFolder(bool embedded=false) {
|
||||
if(embedded)
|
||||
return ":/geoip/";
|
||||
return misc::qBittorrentPath()+"geoip"+QDir::separator();
|
||||
#else
|
||||
static QString geoipFolder(bool) {
|
||||
if(QFile::exists("/usr/local/share/GeoIP/GeoIP.dat"))
|
||||
return "/usr/local/share/GeoIP/";
|
||||
if(QFile::exists("/var/lib/GeoIP/GeoIP.dat"))
|
||||
return "/var/lib/GeoIP/";
|
||||
return "/usr/share/GeoIP/";
|
||||
#endif
|
||||
}
|
||||
|
||||
static QString geoipDBpath(bool embedded=false) {
|
||||
return geoipFolder(embedded)+"GeoIP.dat";
|
||||
}
|
||||
|
||||
static QString geoipVersionPath(bool embedded=false) {
|
||||
return geoipFolder(embedded)+"VERSION";
|
||||
}
|
||||
|
||||
static int getDBVersion(bool embedded = false) {
|
||||
QFile vFile(geoipVersionPath(embedded));
|
||||
qDebug("Reading file at %s", geoipVersionPath(embedded).toLocal8Bit().data());
|
||||
if(vFile.exists() && vFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
qDebug("File exists and was opened");
|
||||
QByteArray v = vFile.readAll().trimmed();
|
||||
/*while(!v.isEmpty() && v[0] == '0') {
|
||||
v = v.mid(1);
|
||||
}*/
|
||||
qDebug("Read version: %s", v.data());
|
||||
bool ok = false;
|
||||
int version = v.toInt(&ok);
|
||||
qDebug("Read version %d (Error? %d)", version, (int) !ok);
|
||||
if(ok) return version;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void updateLocalDb() {
|
||||
if(getDBVersion(true) > getDBVersion(false)) { // Update required
|
||||
#ifdef WITH_GEOIP_EMBEDDED
|
||||
static void exportEmbeddedDb() {
|
||||
if(!QFile::exists(geoipDBpath(false)) || QFile(geoipDBpath(false)).size() != QFile(geoipDBpath(true)).size()) { // Export is required
|
||||
qDebug("A local Geoip database update is required, proceeding...");
|
||||
// Create geoip folder is necessary
|
||||
QDir gfolder(geoipFolder(false));
|
||||
@@ -86,18 +73,18 @@ protected:
|
||||
// Remove destination files
|
||||
if(QFile::exists(geoipDBpath(false)))
|
||||
QFile::remove(geoipDBpath(false));
|
||||
if(QFile::exists(geoipVersionPath(false)))
|
||||
QFile::remove(geoipVersionPath(false));
|
||||
// Copy from executable to hard disk
|
||||
QFile::copy(geoipDBpath(true), geoipDBpath(false));
|
||||
QFile::copy(geoipVersionPath(true), geoipVersionPath(false));
|
||||
qDebug("Local Geoip database was updated");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
public:
|
||||
static void loadDatabase(session *s) {
|
||||
updateLocalDb();
|
||||
#ifdef WITH_GEOIP_EMBEDDED
|
||||
exportEmbeddedDb();
|
||||
#endif
|
||||
if(QFile::exists(geoipDBpath(false))) {
|
||||
qDebug("Loading GeoIP database from %s...", geoipDBpath(false).toLocal8Bit().data());
|
||||
if(!s->load_country_db(geoipDBpath(false).toLocal8Bit().data())) {
|
||||
|
@@ -1,7 +1,5 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource>
|
||||
<file>geoip/GeoIP.dat</file>
|
||||
<file>geoip/VERSION</file>
|
||||
</qresource>
|
||||
<RCC>
|
||||
<qresource prefix="/" >
|
||||
<file>geoip/GeoIP.dat</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
|