Compare commits
1 Commits
release-2.
...
release-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c506a01dea |
8
AUTHORS
@@ -3,18 +3,12 @@ Author:
|
|||||||
|
|
||||||
Contributors:
|
Contributors:
|
||||||
* Stefanos Antaris <santaris@csd.auth.gr>
|
* Stefanos Antaris <santaris@csd.auth.gr>
|
||||||
* Mohammad Dib <mdib@qbittorrent.org>
|
|
||||||
* Mirco Chinelli <infinity89@fastwebmail.it>
|
|
||||||
* Ishan Arora <ishan@qbittorrent.org>
|
* Ishan Arora <ishan@qbittorrent.org>
|
||||||
* Arnaud Demaizière <arnaud@qbittorrent.org>
|
* Arnaud Demaizière <arnaud@qbittorrent.org>
|
||||||
* Grigis Gaëtan <cipher16@gmail.com>
|
* Grigis Gaëtan <cipher16@gmail.com>
|
||||||
* Christian Kandeler <zambesi@users.sourceforge.net>
|
* Christian Kandeler <zambesi@users.sourceforge.net>
|
||||||
|
|
||||||
Code from other projects:
|
Code from other projects:
|
||||||
* files src/qtsingleapp/*
|
|
||||||
copyright: Nokia Corporation
|
|
||||||
license: LGPL
|
|
||||||
|
|
||||||
* files src/ico.cpp src/ico.h
|
* files src/ico.cpp src/ico.h
|
||||||
copyright: Malte Starostik <malte@kde.org>
|
copyright: Malte Starostik <malte@kde.org>
|
||||||
license: LGPL
|
license: LGPL
|
||||||
@@ -66,13 +60,11 @@ Images Authors:
|
|||||||
Translations authors:
|
Translations authors:
|
||||||
* files: src/lang/*.ts
|
* files: src/lang/*.ts
|
||||||
copyright:
|
copyright:
|
||||||
- Arabic: SDERAWI (abz8868@msn.com) and sn51234 (nesseyan@gmail.com)
|
|
||||||
- Brazilian: Nick Marinho (nickmarinho@gmail.com)
|
- Brazilian: Nick Marinho (nickmarinho@gmail.com)
|
||||||
- Bulgarian: Tsvetan & Boyko Bankoff (emerge_life@users.sourceforge.net)
|
- Bulgarian: Tsvetan & Boyko Bankoff (emerge_life@users.sourceforge.net)
|
||||||
- Catalan: Francisco Luque Contreras (frannoe@ya.com)
|
- Catalan: Francisco Luque Contreras (frannoe@ya.com)
|
||||||
- Chinese (Simplified): Guo Yue (yue.guo0418@gmail.com)
|
- Chinese (Simplified): Guo Yue (yue.guo0418@gmail.com)
|
||||||
- Chinese (Traditional): Yi-Shun Wang (dnextstep@gmail.com)
|
- Chinese (Traditional): Yi-Shun Wang (dnextstep@gmail.com)
|
||||||
- Croatian: Oliver Mucafir (oliver.untwist@gmail.com)
|
|
||||||
- Czech: Jirka Vilim (web@tets.cz)
|
- Czech: Jirka Vilim (web@tets.cz)
|
||||||
- Danish: Mathias Nielsen (comoneo@gmail.com)
|
- Danish: Mathias Nielsen (comoneo@gmail.com)
|
||||||
- Dutch: Joost Schipper (heavyjoost@users.sourceforge.net)
|
- Dutch: Joost Schipper (heavyjoost@users.sourceforge.net)
|
||||||
|
|||||||
89
Changelog
@@ -1,92 +1,3 @@
|
|||||||
* Sun Jun 13 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.9
|
|
||||||
- FEATURE: Official support for Win32 platform
|
|
||||||
- FEATURE: Better integration with Mac OS
|
|
||||||
- BUGFIX: Fix torrent availability computation (closes #587337)
|
|
||||||
- BUGFIX: Disable torrent addition dialog as a default
|
|
||||||
- BUGFIX: Fix Web UI authentication with Opera Browser
|
|
||||||
- BUGFIX: Fix Javascript error in Web UI when using IE
|
|
||||||
- BUGFIX: Fix a lot of encoding problems on non UTF-8 systems
|
|
||||||
- BUGFIX: Fix race condition allowing to run multiple instances (closes #286968)
|
|
||||||
- BUGFIX: Fix window hiding problem when having a modal window (closes #589070)
|
|
||||||
|
|
||||||
* Mon May 24 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.8
|
|
||||||
- BUGFIX: ETA for finished torrent is now 0 instead of Infinite (closes #583704)
|
|
||||||
- BUGFIX: Fix sorting of ETA column when having infinite values (closes #583347)
|
|
||||||
- BUGFIX: Torrent queue position now starts at 1 (closes #581130)
|
|
||||||
- BUGFIX: Fix unicode issue in start seeding after torrent creation code
|
|
||||||
- BUGFIX: Fix torrent error state clearance on resuming
|
|
||||||
- BUGFIX: Fix possible checkbox update in Web UI
|
|
||||||
- COSMETIC: Fix torrent properties layout
|
|
||||||
|
|
||||||
* Wed May 12 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.7
|
|
||||||
- BUGFIX: Fix unicode problem in torrent moving code
|
|
||||||
- BUGFIX: Fix possible initialization problem in Web UI
|
|
||||||
- BUGFIX: Fix torrent moving after completion feature
|
|
||||||
- BUGFIX: Improved empty folder removing code
|
|
||||||
- BUGFIX: Use guid or news url as RSS items identifier (instead of title)
|
|
||||||
- BUGFIX: Fix possible crash in RSS item selection code
|
|
||||||
- BUGFIX: Added support for url encoded ampersands in RSS
|
|
||||||
- COSMETIC: Sort torrent labels in popup menu
|
|
||||||
- I18N: Added Croatian translation
|
|
||||||
|
|
||||||
* Sun Apr 18 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.6
|
|
||||||
- BUGFIX: Announce to all trackers at once
|
|
||||||
- BUGFIX: Added support for single-thread boost
|
|
||||||
- BUGFIX: Remove old folder when moving a torrent
|
|
||||||
- BUGFIX: Improved reliability of torrent moving
|
|
||||||
- BUGFIX: Stop rechecking torrents when they are moved
|
|
||||||
- BUGFIX: Status filters height stays correct when the visual style changes
|
|
||||||
- I18N: Added Arabic translation
|
|
||||||
|
|
||||||
* Wed Apr 07 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.5
|
|
||||||
- BUGFIX: Fix crash when adding a new torrent label
|
|
||||||
- BUGFIX: Fix HTTPS protocol support in torrent/rss downloader
|
|
||||||
- BUGFIX: Fix default width of file name column in torrent content
|
|
||||||
- BUGFIX: Fix torrent addition dialog buttons height
|
|
||||||
- BUGFIX: Fix deprecation warnings with libtorrent v0.15
|
|
||||||
- BUGFIX: Fix "Download from URL" title size in Web UI
|
|
||||||
- BUGFIX: Fix transparency of speed limits icons
|
|
||||||
- BUGFIX: Dropped dependency on Qt gif library
|
|
||||||
- BUGFIX: Improved libboost detection by configure file
|
|
||||||
- BUGFIX: Bring back compatibility with boost v1.34
|
|
||||||
- COSMETIC: Added icons to menu actions in Web UI
|
|
||||||
|
|
||||||
* Tue Apr 06 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.4
|
|
||||||
- BUGFIX: Fix possible crash when adding a torrent
|
|
||||||
- BUGFIX: Fix failure to remember some torrents on startup
|
|
||||||
- BUGFIX: Fix torrent addition window layout (torrent content not expanding)
|
|
||||||
- BUGFIX: Fix about dialog in Web UI
|
|
||||||
- BUGFIX: Correctly clear trackers error messages once they work
|
|
||||||
- BUGFIX: Display correct share ratio for paused torrents
|
|
||||||
- COSMETIC: Improved alternative speed limits icons
|
|
||||||
|
|
||||||
* Sun Apr 04 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.3
|
|
||||||
- BUGFIX: Fix possible crash when deleting a torrent just after pausing it
|
|
||||||
- BUGFIX: Enable Apply button when alternative rate limits are changed
|
|
||||||
- BUGFIX: Source compatibility with Windows (Thanks Ishan Arora)
|
|
||||||
- BUGFIX: Source compatibility with eCS (OS/2) (Thanks Silvan Scherrer)
|
|
||||||
- BUGFIX: Cleaner binutils gold linker support
|
|
||||||
- BUGFIX: Clean fix for progress display with cleanlooks style
|
|
||||||
|
|
||||||
* Mon Mar 22 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.2
|
|
||||||
- FEATURE: DHT port can be set from Web UI
|
|
||||||
- BUGFIX: Fix possible crash with folder scanning
|
|
||||||
- BUGFIX: Fix Mac compilation
|
|
||||||
- BUGFIX: Save fast resume data every 3 minutes (for robustness)
|
|
||||||
- I18N: Updated Polish translation (thanks Szymon Świerkosz)
|
|
||||||
|
|
||||||
* Sat Mar 20 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.1
|
|
||||||
- FEATURE: Display pieces that are being downloaded
|
|
||||||
- FEATURE: Added back folder watching in Web UI
|
|
||||||
- FEATURE: Added back file prioritizing in Web UI
|
|
||||||
- BUGFIX: Fix compilation with Qt 4.4
|
|
||||||
- BUGFIX: Fix Web UI compatibility with Safari
|
|
||||||
- BUGFIX: Fix progress display with cleanlook style
|
|
||||||
- BUGFIX: Fix file filtering in complex torrents
|
|
||||||
- BUGFIX: Ask for user confirmation for recursive torrent download
|
|
||||||
- BUGFIX: Fix "add file" dialog in torrent creation tool
|
|
||||||
- BUGFIX: Fix "Ctrl+A" in Web UI
|
|
||||||
|
|
||||||
* Sun Mar 14 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.0
|
* Sun Mar 14 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.0
|
||||||
- FEATURE: User can set alternative speed limits for fast toggling
|
- FEATURE: User can set alternative speed limits for fast toggling
|
||||||
- FEATURE: Bandwidth scheduler (automatically use alternative speed limits for a given period)
|
- FEATURE: Bandwidth scheduler (automatically use alternative speed limits for a given period)
|
||||||
|
|||||||
6
INSTALL
@@ -14,13 +14,11 @@ qBittorrent - A BitTorrent client in C++ / Qt4
|
|||||||
|
|
||||||
- pkg-config executable
|
- pkg-config executable
|
||||||
|
|
||||||
- libtorrent-rasterbar by Arvid Norberg (>= 0.14.4 REQUIRED, compatible with v0.15.x)
|
- 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.
|
||||||
|
|
||||||
- libboost 1.34.x (libboost-filesystem, libboost-thread, libboost-date-time) + libasio
|
- libboost: libboost-filesystem, libboost-date-time, libboost-thread, libboost-serialization
|
||||||
or
|
|
||||||
- libboost >= 1.35.x (libboost-system, libboost-filesystem, libboost-thread, libboost-date-time)
|
|
||||||
|
|
||||||
- python >= 2.3 (needed by search engine)
|
- python >= 2.3 (needed by search engine)
|
||||||
* Run time only dependency
|
* Run time only dependency
|
||||||
|
|||||||
62
README.os2
@@ -1,62 +0,0 @@
|
|||||||
qBittorrent - A BitTorrent client in Qt4
|
|
||||||
------------------------------------------
|
|
||||||
|
|
||||||
This is the eComStation (OS/2) qBittorrent part of the readme. See also README for more general information.
|
|
||||||
|
|
||||||
|
|
||||||
Building qBittorrent
|
|
||||||
********************
|
|
||||||
|
|
||||||
|
|
||||||
Requirements
|
|
||||||
============
|
|
||||||
|
|
||||||
- gcc based build env (recommended gcc v4.4.2 or greater)
|
|
||||||
|
|
||||||
- Qt4 for eCS (OS/2) dev package (see http://svn.netlabs.org/qt4 for more information)
|
|
||||||
|
|
||||||
- libtorrent-rasterbar for eCS (OS/2) port (see http://svn.netlabs.org/ports for more information)
|
|
||||||
|
|
||||||
- boost for eCS (OS/2) port (see http://svn.netlabs.org/ports for more information)
|
|
||||||
|
|
||||||
|
|
||||||
How to build
|
|
||||||
============
|
|
||||||
|
|
||||||
First you need to create the conf.pri file in the same dir as this readme.os2 is.
|
|
||||||
the conf.pri file has the following content:
|
|
||||||
|
|
||||||
##### conf.pri content beginn #####
|
|
||||||
PREFIX = .
|
|
||||||
BINDIR = ./bin
|
|
||||||
INCDIR = ./include
|
|
||||||
LIBDIR = ./lib
|
|
||||||
DATADIR = ./share
|
|
||||||
|
|
||||||
CONFIG += staticlib
|
|
||||||
INCLUDEPATH += x:/trees/libtorrent/trunk/include
|
|
||||||
LIBS += -Lx:/trees/libtorrent/trunk/src/.libs \
|
|
||||||
-Lx:/trees/boost/trunk/stage/lib \
|
|
||||||
-Lx:/trees/openssl \
|
|
||||||
-Lx:/extras/lib
|
|
||||||
##### conf.pri content end #####
|
|
||||||
|
|
||||||
Of course all the above path references have to be adjusted to your build env.
|
|
||||||
|
|
||||||
It should now be easy to build qBittorrent:
|
|
||||||
|
|
||||||
Simply type:
|
|
||||||
$ qmake
|
|
||||||
|
|
||||||
Followed by:
|
|
||||||
$ make
|
|
||||||
|
|
||||||
If all works fine you should get a working qbittorrent executable.
|
|
||||||
|
|
||||||
If you have any question regarding the eCS (OS/2) port of qBittorrent you can meet me (_diver) on IRC:
|
|
||||||
#netlabs on irc.freenode.net
|
|
||||||
|
|
||||||
------------------------------------------
|
|
||||||
Silvan Scherrer <silvan.scherrer@aroa.ch>
|
|
||||||
|
|
||||||
|
|
||||||
86
configure
vendored
@@ -21,7 +21,6 @@ Dependency options:
|
|||||||
--disable-gui Disable qBittorrent Graphical user
|
--disable-gui Disable qBittorrent Graphical user
|
||||||
interface for headless running
|
interface for headless running
|
||||||
--with-libboost-inc=[path] Path to libboost include files
|
--with-libboost-inc=[path] Path to libboost include files
|
||||||
--with-libboost-lib=[path] Path to libboost library files
|
|
||||||
--disable-libnotify Disable use of libnotify
|
--disable-libnotify Disable use of libnotify
|
||||||
--disable-geoip-database Disable use of geoip-database
|
--disable-geoip-database Disable use of geoip-database
|
||||||
--with-geoip-database-embedded Geoip Database will be embedded in
|
--with-geoip-database-embedded Geoip Database will be embedded in
|
||||||
@@ -153,11 +152,6 @@ while [ $# -gt 0 ]; do
|
|||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--with-libboost-lib=*)
|
|
||||||
QC_WITH_LIBBOOST_LIB=$optarg
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
|
|
||||||
--disable-libnotify)
|
--disable-libnotify)
|
||||||
QC_DISABLE_libnotify="Y"
|
QC_DISABLE_libnotify="Y"
|
||||||
shift
|
shift
|
||||||
@@ -196,7 +190,6 @@ echo DATADIR=$DATADIR
|
|||||||
echo EX_QTDIR=$EX_QTDIR
|
echo EX_QTDIR=$EX_QTDIR
|
||||||
echo QC_DISABLE_GUI=$QC_DISABLE_GUI
|
echo QC_DISABLE_GUI=$QC_DISABLE_GUI
|
||||||
echo QC_WITH_LIBBOOST_INC=$QC_WITH_LIBBOOST_INC
|
echo QC_WITH_LIBBOOST_INC=$QC_WITH_LIBBOOST_INC
|
||||||
echo QC_WITH_LIBBOOST_LIB=$QC_WITH_LIBBOOST_LIB
|
|
||||||
echo QC_DISABLE_libnotify=$QC_DISABLE_libnotify
|
echo QC_DISABLE_libnotify=$QC_DISABLE_libnotify
|
||||||
echo QC_DISABLE_geoip_database=$QC_DISABLE_geoip_database
|
echo QC_DISABLE_geoip_database=$QC_DISABLE_geoip_database
|
||||||
echo QC_WITH_GEOIP_DATABASE_EMBEDDED=$QC_WITH_GEOIP_DATABASE_EMBEDDED
|
echo QC_WITH_GEOIP_DATABASE_EMBEDDED=$QC_WITH_GEOIP_DATABASE_EMBEDDED
|
||||||
@@ -355,15 +348,25 @@ public:
|
|||||||
bool exec(){
|
bool exec(){
|
||||||
QStringList incs;
|
QStringList incs;
|
||||||
QString req_ver = "0.14.4";
|
QString req_ver = "0.14.4";
|
||||||
|
QString adv_ver = "0.15.0";
|
||||||
QString version, libs, other;
|
QString version, libs, other;
|
||||||
VersionMode mode = VersionMin;
|
VersionMode mode = VersionMin;
|
||||||
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other))
|
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other))
|
||||||
return false;
|
return false;
|
||||||
for(int n = 0; n < incs.count(); ++n)
|
for(int n = 0; n < incs.count(); ++n)
|
||||||
conf->addIncludePath(incs[n]);
|
conf->addIncludePath(incs[n]);
|
||||||
if(conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
//if(!libs.isEmpty())
|
||||||
conf->addLib("-lcrypto");
|
// conf->addLib(libs);
|
||||||
}
|
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, adv_ver, &version, &incs, &libs, &other))
|
||||||
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -372,39 +375,14 @@ public:
|
|||||||
-----BEGIN QCMOD-----
|
-----BEGIN QCMOD-----
|
||||||
name: libboost
|
name: libboost
|
||||||
arg: with-libboost-inc=[path], Path to libboost include files
|
arg: with-libboost-inc=[path], Path to libboost include files
|
||||||
arg: with-libboost-lib=[path], Path to libboost library files
|
|
||||||
-----END QCMOD-----
|
-----END QCMOD-----
|
||||||
*/
|
*/
|
||||||
#include <boost/version.hpp>
|
|
||||||
class qc_libboost : public ConfObj
|
class qc_libboost : public ConfObj
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
qc_libboost(Conf *c) : ConfObj(c) {}
|
qc_libboost(Conf *c) : ConfObj(c) {}
|
||||||
QString name() const { return "libboost"; }
|
QString name() const { return "libboost"; }
|
||||||
QString shortname() const { return "libboost"; }
|
QString shortname() const { return "libboost"; }
|
||||||
QString findBoostLib(QString path, QString lib) const {
|
|
||||||
QString name;
|
|
||||||
QDir libDir(path);
|
|
||||||
QStringList filters;
|
|
||||||
filters << "libboost_"+lib+"*-mt*.so";
|
|
||||||
QStringList result = libDir.entryList(filters, QDir::Files);
|
|
||||||
if(!result.empty()) {
|
|
||||||
name = result.first().mid(3);
|
|
||||||
// Remove .so
|
|
||||||
name.chop(3);
|
|
||||||
} else {
|
|
||||||
// Fall back to non -mt boost lib
|
|
||||||
filters.clear();
|
|
||||||
filters << "libboost_"+lib+"*.so";
|
|
||||||
result = libDir.entryList(filters, QDir::Files);
|
|
||||||
if(!result.empty()) {
|
|
||||||
name = result.first().mid(3);
|
|
||||||
// Remove .so
|
|
||||||
name.chop(3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
bool exec(){
|
bool exec(){
|
||||||
QString s;
|
QString s;
|
||||||
s = conf->getenv("QC_WITH_LIBBOOST_INC");
|
s = conf->getenv("QC_WITH_LIBBOOST_INC");
|
||||||
@@ -446,43 +424,6 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
conf->addIncludePath(s);
|
conf->addIncludePath(s);
|
||||||
// Find library
|
|
||||||
s = conf->getenv("QC_WITH_LIBBOOST_LIB");
|
|
||||||
QStringList required_libs;
|
|
||||||
#if BOOST_VERSION >= 103500
|
|
||||||
required_libs << "system";
|
|
||||||
#endif
|
|
||||||
if(conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
|
||||||
// Not required by nox
|
|
||||||
required_libs << "filesystem" << "thread";
|
|
||||||
}
|
|
||||||
QStringList libDirs;
|
|
||||||
libDirs << "/usr/lib/" << "/usr/lib64/" << "/usr/local/lib/" << "/usr/local/lib64/";
|
|
||||||
foreach(const QString& lib, required_libs) {
|
|
||||||
if(!s.isEmpty()) {
|
|
||||||
QString detected_name = findBoostLib(s, lib);
|
|
||||||
if(detected_name.isEmpty()) {
|
|
||||||
printf("Could not find boost %s library!\n", qPrintable(lib));
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
conf->addLib("-l"+detected_name);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
bool found = false;
|
|
||||||
foreach(const QString& libDir, libDirs) {
|
|
||||||
QString detected_name = findBoostLib(libDir, lib);
|
|
||||||
if(!detected_name.isEmpty()) {
|
|
||||||
conf->addLib("-l"+detected_name);
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!found) {
|
|
||||||
printf("Could not find boost %s library!\n", qPrintable(lib));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1542,7 +1483,6 @@ export DATADIR
|
|||||||
export EX_QTDIR
|
export EX_QTDIR
|
||||||
export QC_DISABLE_GUI
|
export QC_DISABLE_GUI
|
||||||
export QC_WITH_LIBBOOST_INC
|
export QC_WITH_LIBBOOST_INC
|
||||||
export QC_WITH_LIBBOOST_LIB
|
|
||||||
export QC_DISABLE_libnotify
|
export QC_DISABLE_libnotify
|
||||||
export QC_DISABLE_geoip_database
|
export QC_DISABLE_geoip_database
|
||||||
export QC_WITH_GEOIP_DATABASE_EMBEDDED
|
export QC_WITH_GEOIP_DATABASE_EMBEDDED
|
||||||
|
|||||||
@@ -2,39 +2,14 @@
|
|||||||
-----BEGIN QCMOD-----
|
-----BEGIN QCMOD-----
|
||||||
name: libboost
|
name: libboost
|
||||||
arg: with-libboost-inc=[path], Path to libboost include files
|
arg: with-libboost-inc=[path], Path to libboost include files
|
||||||
arg: with-libboost-lib=[path], Path to libboost library files
|
|
||||||
-----END QCMOD-----
|
-----END QCMOD-----
|
||||||
*/
|
*/
|
||||||
#include <boost/version.hpp>
|
|
||||||
class qc_libboost : public ConfObj
|
class qc_libboost : public ConfObj
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
qc_libboost(Conf *c) : ConfObj(c) {}
|
qc_libboost(Conf *c) : ConfObj(c) {}
|
||||||
QString name() const { return "libboost"; }
|
QString name() const { return "libboost"; }
|
||||||
QString shortname() const { return "libboost"; }
|
QString shortname() const { return "libboost"; }
|
||||||
QString findBoostLib(QString path, QString lib) const {
|
|
||||||
QString name;
|
|
||||||
QDir libDir(path);
|
|
||||||
QStringList filters;
|
|
||||||
filters << "libboost_"+lib+"*-mt*.so";
|
|
||||||
QStringList result = libDir.entryList(filters, QDir::Files);
|
|
||||||
if(!result.empty()) {
|
|
||||||
name = result.first().mid(3);
|
|
||||||
// Remove .so
|
|
||||||
name.chop(3);
|
|
||||||
} else {
|
|
||||||
// Fall back to non -mt boost lib
|
|
||||||
filters.clear();
|
|
||||||
filters << "libboost_"+lib+"*.so";
|
|
||||||
result = libDir.entryList(filters, QDir::Files);
|
|
||||||
if(!result.empty()) {
|
|
||||||
name = result.first().mid(3);
|
|
||||||
// Remove .so
|
|
||||||
name.chop(3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
bool exec(){
|
bool exec(){
|
||||||
QString s;
|
QString s;
|
||||||
s = conf->getenv("QC_WITH_LIBBOOST_INC");
|
s = conf->getenv("QC_WITH_LIBBOOST_INC");
|
||||||
@@ -76,43 +51,6 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
conf->addIncludePath(s);
|
conf->addIncludePath(s);
|
||||||
// Find library
|
|
||||||
s = conf->getenv("QC_WITH_LIBBOOST_LIB");
|
|
||||||
QStringList required_libs;
|
|
||||||
#if BOOST_VERSION >= 103500
|
|
||||||
required_libs << "system";
|
|
||||||
#endif
|
|
||||||
if(conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
|
||||||
// Not required by nox
|
|
||||||
required_libs << "filesystem" << "thread";
|
|
||||||
}
|
|
||||||
QStringList libDirs;
|
|
||||||
libDirs << "/usr/lib/" << "/usr/lib64/" << "/usr/local/lib/" << "/usr/local/lib64/";
|
|
||||||
foreach(const QString& lib, required_libs) {
|
|
||||||
if(!s.isEmpty()) {
|
|
||||||
QString detected_name = findBoostLib(s, lib);
|
|
||||||
if(detected_name.isEmpty()) {
|
|
||||||
printf("Could not find boost %s library!\n", qPrintable(lib));
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
conf->addLib("-l"+detected_name);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
bool found = false;
|
|
||||||
foreach(const QString& libDir, libDirs) {
|
|
||||||
QString detected_name = findBoostLib(libDir, lib);
|
|
||||||
if(!detected_name.isEmpty()) {
|
|
||||||
conf->addLib("-l"+detected_name);
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!found) {
|
|
||||||
printf("Could not find boost %s library!\n", qPrintable(lib));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,15 +13,25 @@ public:
|
|||||||
bool exec(){
|
bool exec(){
|
||||||
QStringList incs;
|
QStringList incs;
|
||||||
QString req_ver = "0.14.4";
|
QString req_ver = "0.14.4";
|
||||||
|
QString adv_ver = "0.15.0";
|
||||||
QString version, libs, other;
|
QString version, libs, other;
|
||||||
VersionMode mode = VersionMin;
|
VersionMode mode = VersionMin;
|
||||||
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other))
|
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other))
|
||||||
return false;
|
return false;
|
||||||
for(int n = 0; n < incs.count(); ++n)
|
for(int n = 0; n < incs.count(); ++n)
|
||||||
conf->addIncludePath(incs[n]);
|
conf->addIncludePath(incs[n]);
|
||||||
if(conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
//if(!libs.isEmpty())
|
||||||
conf->addLib("-lcrypto");
|
// conf->addLib(libs);
|
||||||
}
|
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, adv_ver, &version, &incs, &libs, &other))
|
||||||
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
139
src/GUI.cpp
10
src/GUI.h
@@ -43,6 +43,7 @@ class Bittorrent;
|
|||||||
class QTimer;
|
class QTimer;
|
||||||
class downloadFromURL;
|
class downloadFromURL;
|
||||||
class SearchEngine;
|
class SearchEngine;
|
||||||
|
class QLocalServer;
|
||||||
class QCloseEvent;
|
class QCloseEvent;
|
||||||
class RSSImp;
|
class RSSImp;
|
||||||
class QShortcut;
|
class QShortcut;
|
||||||
@@ -69,7 +70,6 @@ public:
|
|||||||
// Methods
|
// Methods
|
||||||
int getCurrentTabIndex() const;
|
int getCurrentTabIndex() const;
|
||||||
TransferListWidget* getTransferList() const { return transferList; }
|
TransferListWidget* getTransferList() const { return transferList; }
|
||||||
QMenu* getTrayIconMenu();
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void trackerAuthenticationRequired(QTorrentHandle& h);
|
void trackerAuthenticationRequired(QTorrentHandle& h);
|
||||||
@@ -88,6 +88,8 @@ protected slots:
|
|||||||
void on_actionWebsite_triggered() const;
|
void on_actionWebsite_triggered() const;
|
||||||
void on_actionBugReport_triggered() const;
|
void on_actionBugReport_triggered() const;
|
||||||
void on_actionShow_console_triggered();
|
void on_actionShow_console_triggered();
|
||||||
|
void readParamsOnSocket();
|
||||||
|
void acceptConnection();
|
||||||
void balloonClicked();
|
void balloonClicked();
|
||||||
void writeSettings();
|
void writeSettings();
|
||||||
void readSettings();
|
void readSettings();
|
||||||
@@ -109,13 +111,11 @@ protected slots:
|
|||||||
void on_actionOpen_triggered();
|
void on_actionOpen_triggered();
|
||||||
void updateGUI();
|
void updateGUI();
|
||||||
void loadPreferences(bool configure_session=true);
|
void loadPreferences(bool configure_session=true);
|
||||||
void processParams(const QString& params);
|
|
||||||
void processParams(const QStringList& params);
|
void processParams(const QStringList& params);
|
||||||
void addTorrent(QString path);
|
void addTorrent(QString path);
|
||||||
void addUnauthenticatedTracker(const QPair<QTorrentHandle,QString> &tracker);
|
void addUnauthenticatedTracker(const QPair<QTorrentHandle,QString> &tracker);
|
||||||
void processDownloadedFiles(QString path, QString url);
|
void processDownloadedFiles(QString path, QString url);
|
||||||
void finishedTorrent(QTorrentHandle& h) const;
|
void finishedTorrent(QTorrentHandle& h) const;
|
||||||
void askRecursiveTorrentDownloadConfirmation(QTorrentHandle &h);
|
|
||||||
// Options slots
|
// Options slots
|
||||||
void on_actionOptions_triggered();
|
void on_actionOptions_triggered();
|
||||||
void optionsSaved();
|
void optionsSaved();
|
||||||
@@ -143,7 +143,7 @@ private:
|
|||||||
QPointer<downloadFromURL> downloadFromURLDialog;
|
QPointer<downloadFromURL> downloadFromURLDialog;
|
||||||
QPointer<QSystemTrayIcon> systrayIcon;
|
QPointer<QSystemTrayIcon> systrayIcon;
|
||||||
QPointer<QTimer> systrayCreator;
|
QPointer<QTimer> systrayCreator;
|
||||||
QPointer<QMenu> myTrayIconMenu;
|
QMenu *myTrayIconMenu;
|
||||||
TransferListWidget *transferList;
|
TransferListWidget *transferList;
|
||||||
TransferListFiltersWidget *transferListFilters;
|
TransferListFiltersWidget *transferListFilters;
|
||||||
PropertiesWidget *properties;
|
PropertiesWidget *properties;
|
||||||
@@ -163,6 +163,8 @@ private:
|
|||||||
SearchEngine *searchEngine;
|
SearchEngine *searchEngine;
|
||||||
// RSS
|
// RSS
|
||||||
QPointer<RSSImp> rssWidget;
|
QPointer<RSSImp> rssWidget;
|
||||||
|
// Misc
|
||||||
|
QLocalServer *localServer;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 546 B |
@@ -1,9 +1,8 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Categories=Qt;Network;P2P;
|
Categories=Qt;Network;P2P;
|
||||||
Comment=V2.2.9
|
Comment=V2.2.0
|
||||||
Exec=qbittorrent %f
|
Exec=qbittorrent %f
|
||||||
GenericName=Bittorrent client
|
GenericName=Bittorrent client
|
||||||
GenericName[ar]=العميل Bittorrent
|
|
||||||
GenericName[bg]=Торент клиент
|
GenericName[bg]=Торент клиент
|
||||||
GenericName[cs]=Bittorrent klient
|
GenericName[cs]=Bittorrent klient
|
||||||
GenericName[de]=Bittorren Client
|
GenericName[de]=Bittorren Client
|
||||||
@@ -11,7 +10,6 @@ GenericName[el]=Bittorrent πελάτης
|
|||||||
GenericName[es]=Cliente Bittorrent
|
GenericName[es]=Cliente Bittorrent
|
||||||
GenericName[fi]=Bittorrent-ohjelma
|
GenericName[fi]=Bittorrent-ohjelma
|
||||||
GenericName[fr]=Client Bittorrent
|
GenericName[fr]=Client Bittorrent
|
||||||
GenericName[hr]=Bittorrent klijent
|
|
||||||
GenericName[hu]=Bittorrent kliens
|
GenericName[hu]=Bittorrent kliens
|
||||||
GenericName[it]=Client Bittorrent
|
GenericName[it]=Client Bittorrent
|
||||||
GenericName[ja]=Bittorrent クライアント
|
GenericName[ja]=Bittorrent クライアント
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 910 B |
BIN
src/Icons/slow48.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 680 B |
@@ -1,60 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleDocumentTypes</key>
|
|
||||||
<array>
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleTypeExtensions</key>
|
|
||||||
<array>
|
|
||||||
<string>torrent</string>
|
|
||||||
</array>
|
|
||||||
<key>CFBundleTypeIconFile</key>
|
|
||||||
<string>qbittorrentDocument</string>
|
|
||||||
<key>CFBundleTypeName</key>
|
|
||||||
<string>BitTorrent Document</string>
|
|
||||||
<key>CFBundleTypeMIMETypes</key>
|
|
||||||
<array>
|
|
||||||
<string>application/x-bittorrent</string>
|
|
||||||
</array>
|
|
||||||
<key>CFBundleTypeRole</key>
|
|
||||||
<string>Viewer</string>
|
|
||||||
<key>LSHandlerRank</key>
|
|
||||||
<string>Owner</string>
|
|
||||||
<key>LSItemContentTypes</key>
|
|
||||||
<array>
|
|
||||||
<string>org.bittorrent.torrent</string>
|
|
||||||
</array>
|
|
||||||
<key>LSIsAppleDefaultForType</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
</array>
|
|
||||||
<key>CFBundleURLTypes</key>
|
|
||||||
<array>
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleURLSchemes</key>
|
|
||||||
<array>
|
|
||||||
<string>magnet</string>
|
|
||||||
</array>
|
|
||||||
<key>CFBundleURLName</key>
|
|
||||||
<string>BitTorrent Magnet URL</string>
|
|
||||||
</dict>
|
|
||||||
</array>
|
|
||||||
<key>CFBundleIconFile</key>
|
|
||||||
<string>qbittorrent_mac.icns</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>APPL</string>
|
|
||||||
<key>CFBundleGetInfoString</key>
|
|
||||||
<string>2.2.9</string>
|
|
||||||
<key>CFBundleSignature</key>
|
|
||||||
<string>????</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>qbittorrent</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>org.qbittorrent</string>
|
|
||||||
<key>NOTE</key>
|
|
||||||
<string>This file was generated by Qt/QMake.</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
@@ -54,21 +54,19 @@ class about : public QDialog, private Ui::AboutDlg{
|
|||||||
te_thanks->append(QString::fromUtf8("<a name='top'></a>"));
|
te_thanks->append(QString::fromUtf8("<a name='top'></a>"));
|
||||||
te_thanks->append(QString::fromUtf8("<ul><li>I would first like to thank sourceforge.net for hosting qBittorrent project and for their support.</li>"));
|
te_thanks->append(QString::fromUtf8("<ul><li>I would first like to thank sourceforge.net for hosting qBittorrent project and for their support.</li>"));
|
||||||
te_thanks->append(QString::fromUtf8("<li>I am pleased that people from all over the world are contributing to qBittorrent: Ishan Arora (India), Arnaud Demaizière (France) and Stephanos Antaris (Greece). Their help is greatly appreciated</li>"));
|
te_thanks->append(QString::fromUtf8("<li>I am pleased that people from all over the world are contributing to qBittorrent: Ishan Arora (India), Arnaud Demaizière (France) and Stephanos Antaris (Greece). Their help is greatly appreciated</li>"));
|
||||||
te_thanks->append(QString::fromUtf8("<li>I also want to thank Στέφανος Αντάρης (santaris@csd.auth.gr) and Mirco Chinelli (infinity89@fastwebmail.it) for working on Mac OS X packaging.</li>"));
|
te_thanks->append(QString::fromUtf8("<li>I also want to thank Jeffery Fernandez (jeffery@qbittorrent.org), project consultant, for his help and support since the beginning of this project.</li>"));
|
||||||
te_thanks->append(QString::fromUtf8("<li>I am grateful to Peter Koeleman (peter@qbittorrent.org) and Mohammad Dib (mdib@qbittorrent.org) for working on qBittorrent port to Windows.</li>"));
|
te_thanks->append(QString::fromUtf8("<li>I am grateful to Peter Koeleman (peter@qbittorrent.org) for working on qBittorrent port to Windows.</li>"));
|
||||||
te_thanks->append(QString::fromUtf8("<li>Thanks a lot to our graphist Mateusz Toboła (tobejodok@qbittorrent.org) for his great work.</li></ul><br><br>"));
|
te_thanks->append(QString::fromUtf8("<li>Thanks a lot to our graphist Mateusz Toboła (tobejodok@qbittorrent.org) for his great work.</li></ul><br><br>"));
|
||||||
te_thanks->scrollToAnchor(QString::fromUtf8("top"));
|
te_thanks->scrollToAnchor(QString::fromUtf8("top"));
|
||||||
// Translation
|
// Translation
|
||||||
te_translation->append(QString::fromUtf8("<a name='top'></a>"));
|
te_translation->append(QString::fromUtf8("<a name='top'></a>"));
|
||||||
te_translation->append(tr("I would like to thank the following people who volunteered to translate qBittorrent:")+QString::fromUtf8("<br>"));
|
te_translation->append(tr("I would like to thank the following people who volunteered to translate qBittorrent:")+QString::fromUtf8("<br>"));
|
||||||
te_translation->append(QString::fromUtf8(
|
te_translation->append(QString::fromUtf8(
|
||||||
"<i><u>Arabic:</u> SDERAWI (abz8868@msn.com) and sn51234 (nesseyan@gmail.com)<br>\
|
"<i>- <u>Brazilian:</u> Nick Marinho (nickmarinho@gmail.com)<br>\
|
||||||
- <u>Brazilian:</u> Nick Marinho (nickmarinho@gmail.com)<br>\
|
|
||||||
- <u>Bulgarian:</u> Tsvetan & Boyko Bankoff (emerge_life@users.sourceforge.net)<br>\
|
- <u>Bulgarian:</u> Tsvetan & Boyko Bankoff (emerge_life@users.sourceforge.net)<br>\
|
||||||
- <u>Catalan:</u> Francisco Luque Contreras (frannoe@ya.com)<br>\
|
- <u>Catalan:</u> Francisco Luque Contreras (frannoe@ya.com)<br>\
|
||||||
- <u>Chinese (Simplified):</u> Guo Yue (yue.guo0418@gmail.com)<br>\
|
- <u>Chinese (Simplified):</u> Guo Yue (yue.guo0418@gmail.com)<br>\
|
||||||
- <u>Chinese (Traditional):</u> Yi-Shun Wang (dnextstep@gmail.com)<br>\
|
- <u>Chinese (Traditional):</u> Yi-Shun Wang (dnextstep@gmail.com)<br>\
|
||||||
- <u>Croatian:</u> Oliver Mucafir (oliver.untwist@gmail.com)<br>\
|
|
||||||
- <u>Czech:</u> Jirka Vilim (web@tets.cz)<br>\
|
- <u>Czech:</u> Jirka Vilim (web@tets.cz)<br>\
|
||||||
- <u>Danish:</u> Mathias Nielsen (comoneo@gmail.com)<br>\
|
- <u>Danish:</u> Mathias Nielsen (comoneo@gmail.com)<br>\
|
||||||
- <u>Dutch:</u> Joost Schipper (heavyjoost@users.sourceforge.net) and Peter Koeleman (peter@peerweb.nl)<br>\
|
- <u>Dutch:</u> Joost Schipper (heavyjoost@users.sourceforge.net) and Peter Koeleman (peter@peerweb.nl)<br>\
|
||||||
@@ -94,9 +92,6 @@ class about : public QDialog, private Ui::AboutDlg{
|
|||||||
te_translation->scrollToAnchor(QString::fromUtf8("top"));
|
te_translation->scrollToAnchor(QString::fromUtf8("top"));
|
||||||
// License
|
// License
|
||||||
te_license->append(QString::fromUtf8("<a name='top'></a>"));
|
te_license->append(QString::fromUtf8("<a name='top'></a>"));
|
||||||
#ifdef Q_WS_WIN
|
|
||||||
te_license->append(QString::fromUtf8("qBittorrent is licensed under the GNU General Public License version 2."));
|
|
||||||
#else
|
|
||||||
te_license->append(QString::fromUtf8("qBittorrent is licensed under the GNU General Public License version 2 with the\
|
te_license->append(QString::fromUtf8("qBittorrent is licensed under the GNU General Public License version 2 with the\
|
||||||
addition of the following special exception:\
|
addition of the following special exception:\
|
||||||
<br><br>\
|
<br><br>\
|
||||||
@@ -443,7 +438,6 @@ exception statement from your version.</i>\
|
|||||||
consider it more useful to permit linking proprietary applications with the<br>\
|
consider it more useful to permit linking proprietary applications with the<br>\
|
||||||
library. If this is what you want to do, use the GNU Library General<br>\
|
library. If this is what you want to do, use the GNU Library General<br>\
|
||||||
Public License instead of this License.<br>"));
|
Public License instead of this License.<br>"));
|
||||||
#endif
|
|
||||||
te_license->scrollToAnchor(QString::fromUtf8("top"));
|
te_license->scrollToAnchor(QString::fromUtf8("top"));
|
||||||
show();
|
show();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <QSpinBox>
|
#include <QSpinBox>
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
#include <libtorrent/version.hpp>
|
|
||||||
#include "preferences.h"
|
#include "preferences.h"
|
||||||
|
|
||||||
enum AdvSettingsCols {PROPERTY, VALUE};
|
enum AdvSettingsCols {PROPERTY, VALUE};
|
||||||
|
|||||||
4125
src/bittorrent.cpp
@@ -41,9 +41,7 @@
|
|||||||
#include <QPalette>
|
#include <QPalette>
|
||||||
#endif
|
#endif
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QTimer>
|
|
||||||
|
|
||||||
#include <libtorrent/version.hpp>
|
|
||||||
#include <libtorrent/session.hpp>
|
#include <libtorrent/session.hpp>
|
||||||
#include <libtorrent/ip_filter.hpp>
|
#include <libtorrent/ip_filter.hpp>
|
||||||
#include "qtorrenthandle.h"
|
#include "qtorrenthandle.h"
|
||||||
@@ -64,7 +62,7 @@ public:
|
|||||||
QString name_or_url;
|
QString name_or_url;
|
||||||
QString last_message;
|
QString last_message;
|
||||||
unsigned long num_peers;
|
unsigned long num_peers;
|
||||||
#if LIBTORRENT_VERSION_MINOR < 15
|
#ifndef LIBTORRENT_0_15
|
||||||
bool verified;
|
bool verified;
|
||||||
uint fail_count;
|
uint fail_count;
|
||||||
#endif
|
#endif
|
||||||
@@ -75,13 +73,13 @@ public:
|
|||||||
Q_ASSERT(!name_or_url.isEmpty());
|
Q_ASSERT(!name_or_url.isEmpty());
|
||||||
last_message = b.last_message;
|
last_message = b.last_message;
|
||||||
num_peers = b.num_peers;
|
num_peers = b.num_peers;
|
||||||
#if LIBTORRENT_VERSION_MINOR < 15
|
#ifndef LIBTORRENT_0_15
|
||||||
verified = b.verified;
|
verified = b.verified;
|
||||||
fail_count = b.fail_count;
|
fail_count = b.fail_count;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
TrackerInfos(QString name_or_url): name_or_url(name_or_url), last_message(""), num_peers(0) {
|
TrackerInfos(QString name_or_url): name_or_url(name_or_url), last_message(""), num_peers(0) {
|
||||||
#if LIBTORRENT_VERSION_MINOR < 15
|
#ifndef LIBTORRENT_0_15
|
||||||
fail_count = 0;
|
fail_count = 0;
|
||||||
verified = false;
|
verified = false;
|
||||||
#endif
|
#endif
|
||||||
@@ -117,7 +115,6 @@ public:
|
|||||||
qlonglong getETA(QString hash);
|
qlonglong getETA(QString hash);
|
||||||
bool useTemporaryFolder() const;
|
bool useTemporaryFolder() const;
|
||||||
QString getDefaultSavePath() const;
|
QString getDefaultSavePath() const;
|
||||||
ScanFoldersModel* getScanFoldersModel() const;
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
QTorrentHandle addTorrent(QString path, bool fromScanDir = false, QString from_url = QString(), bool resumed = false);
|
QTorrentHandle addTorrent(QString path, bool fromScanDir = false, QString from_url = QString(), bool resumed = false);
|
||||||
@@ -136,9 +133,7 @@ public slots:
|
|||||||
void resumeTorrent(QString hash);
|
void resumeTorrent(QString hash);
|
||||||
void resumeAllTorrents();
|
void resumeAllTorrents();
|
||||||
/* End Web UI */
|
/* End Web UI */
|
||||||
#if LIBTORRENT_VERSION_MINOR < 15
|
|
||||||
void saveDHTEntry();
|
void saveDHTEntry();
|
||||||
#endif
|
|
||||||
void preAllocateAllFiles(bool b);
|
void preAllocateAllFiles(bool b);
|
||||||
void saveFastResumeData();
|
void saveFastResumeData();
|
||||||
void enableIPFilter(QString filter);
|
void enableIPFilter(QString filter);
|
||||||
@@ -164,7 +159,7 @@ public slots:
|
|||||||
void setAppendLabelToSavePath(bool append);
|
void setAppendLabelToSavePath(bool append);
|
||||||
void appendLabelToTorrentSavePath(QTorrentHandle h);
|
void appendLabelToTorrentSavePath(QTorrentHandle h);
|
||||||
void changeLabelInTorrentSavePath(QTorrentHandle h, QString old_label, QString new_label);
|
void changeLabelInTorrentSavePath(QTorrentHandle h, QString old_label, QString new_label);
|
||||||
#if LIBTORRENT_VERSION_MINOR > 14
|
#ifdef LIBTORRENT_0_15
|
||||||
void appendqBextensionToTorrent(QTorrentHandle h, bool append);
|
void appendqBextensionToTorrent(QTorrentHandle h, bool append);
|
||||||
void setAppendqBExtension(bool append);
|
void setAppendqBExtension(bool append);
|
||||||
#endif
|
#endif
|
||||||
@@ -186,7 +181,6 @@ public slots:
|
|||||||
void downloadFromURLList(const QStringList& urls);
|
void downloadFromURLList(const QStringList& urls);
|
||||||
void configureSession();
|
void configureSession();
|
||||||
void banIP(QString ip);
|
void banIP(QString ip);
|
||||||
void recursiveTorrentDownload(const QTorrentHandle &h);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QString getSavePath(QString hash, bool fromScanDir = false, QString filePath = QString());
|
QString getSavePath(QString hash, bool fromScanDir = false, QString filePath = QString());
|
||||||
@@ -198,7 +192,6 @@ protected slots:
|
|||||||
void deleteBigRatios();
|
void deleteBigRatios();
|
||||||
void takeETASamples();
|
void takeETASamples();
|
||||||
void exportTorrentFiles(QString path);
|
void exportTorrentFiles(QString path);
|
||||||
void saveTempFastResumeData();
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void addedTorrent(QTorrentHandle& h);
|
void addedTorrent(QTorrentHandle& h);
|
||||||
@@ -217,7 +210,6 @@ signals:
|
|||||||
void savePathChanged(QTorrentHandle &h);
|
void savePathChanged(QTorrentHandle &h);
|
||||||
void newConsoleMessage(QString msg);
|
void newConsoleMessage(QString msg);
|
||||||
void alternativeSpeedsModeChanged(bool alternative);
|
void alternativeSpeedsModeChanged(bool alternative);
|
||||||
void recursiveTorrentDownloadPossible(QTorrentHandle &h);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Bittorrent
|
// Bittorrent
|
||||||
@@ -227,7 +219,6 @@ private:
|
|||||||
QMap<QUrl, QString> savepath_fromurl;
|
QMap<QUrl, QString> savepath_fromurl;
|
||||||
QHash<QString, QHash<QString, TrackerInfos> > trackersInfos;
|
QHash<QString, QHash<QString, TrackerInfos> > trackersInfos;
|
||||||
QStringList torrentsToPausedAfterChecking;
|
QStringList torrentsToPausedAfterChecking;
|
||||||
QTimer resumeDataTimer;
|
|
||||||
// Ratio
|
// Ratio
|
||||||
QPointer<QTimer> BigRatioTimer;
|
QPointer<QTimer> BigRatioTimer;
|
||||||
// HTTP
|
// HTTP
|
||||||
@@ -250,7 +241,7 @@ private:
|
|||||||
bool queueingEnabled;
|
bool queueingEnabled;
|
||||||
bool appendLabelToSavePath;
|
bool appendLabelToSavePath;
|
||||||
bool torrentExport;
|
bool torrentExport;
|
||||||
#if LIBTORRENT_VERSION_MINOR > 14
|
#ifdef LIBTORRENT_0_15
|
||||||
bool appendqBExtension;
|
bool appendqBExtension;
|
||||||
#endif
|
#endif
|
||||||
QString defaultSavePath;
|
QString defaultSavePath;
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
#include <boost/filesystem/fstream.hpp>
|
#include <boost/filesystem/fstream.hpp>
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
|
|
||||||
#include <libtorrent/version.hpp>
|
|
||||||
#include <libtorrent/entry.hpp>
|
#include <libtorrent/entry.hpp>
|
||||||
#include <libtorrent/bencode.hpp>
|
#include <libtorrent/bencode.hpp>
|
||||||
#include <libtorrent/torrent_info.hpp>
|
#include <libtorrent/torrent_info.hpp>
|
||||||
@@ -81,22 +80,14 @@ createtorrent::~createtorrent() {
|
|||||||
|
|
||||||
void createtorrent::on_addFolder_button_clicked(){
|
void createtorrent::on_addFolder_button_clicked(){
|
||||||
QString dir = QFileDialog::getExistingDirectory(this, tr("Select a folder to add to the torrent"), QDir::homePath(), QFileDialog::ShowDirsOnly);
|
QString dir = QFileDialog::getExistingDirectory(this, tr("Select a folder to add to the torrent"), QDir::homePath(), QFileDialog::ShowDirsOnly);
|
||||||
if(!dir.isEmpty()) {
|
if(!dir.isEmpty())
|
||||||
#ifdef Q_WS_WIN
|
|
||||||
dir = dir.replace("/", "\\");
|
|
||||||
#endif
|
|
||||||
textInputPath->setText(dir);
|
textInputPath->setText(dir);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void createtorrent::on_addFile_button_clicked(){
|
void createtorrent::on_addFile_button_clicked(){
|
||||||
QString file = QFileDialog::getOpenFileName(this, tr("Select a file to add to the torrent"), QDir::homePath());
|
QString file = QFileDialog::getOpenFileName(this, tr("Select a file to add to the torrent"), QDir::homePath(), QString(), 0, QFileDialog::ShowDirsOnly);
|
||||||
if(!file.isEmpty()) {
|
if(!file.isEmpty())
|
||||||
#ifdef Q_WS_WIN
|
|
||||||
file = file.replace("/", "\\");
|
|
||||||
#endif
|
|
||||||
textInputPath->setText(file);
|
textInputPath->setText(file);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void createtorrent::on_removeTracker_button_clicked() {
|
void createtorrent::on_removeTracker_button_clicked() {
|
||||||
@@ -202,14 +193,14 @@ void createtorrent::handleCreationSuccess(QString path, const char* branch_path)
|
|||||||
// Create save path temp data
|
// Create save path temp data
|
||||||
boost::intrusive_ptr<torrent_info> t;
|
boost::intrusive_ptr<torrent_info> t;
|
||||||
try {
|
try {
|
||||||
t = new torrent_info(path.toUtf8().data());
|
t = new torrent_info(path.toLocal8Bit().data());
|
||||||
} catch(std::exception&) {
|
} catch(std::exception&) {
|
||||||
QMessageBox::critical(0, tr("Torrent creation"), tr("Created torrent file is invalid. It won't be added to download list."));
|
QMessageBox::critical(0, tr("Torrent creation"), tr("Created torrent file is invalid. It won't be added to download list."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QString hash = misc::toQString(t->info_hash());
|
QString hash = misc::toQString(t->info_hash());
|
||||||
TorrentTempData::setSavePath(hash, QString::fromLocal8Bit(branch_path));
|
TorrentTempData::setSavePath(hash, QString(branch_path));
|
||||||
#if LIBTORRENT_VERSION_MINOR > 14
|
#ifdef LIBTORRENT_0_15
|
||||||
// Enable seeding mode (do not recheck the files)
|
// Enable seeding mode (do not recheck the files)
|
||||||
TorrentTempData::setSeedingMode(hash, true);
|
TorrentTempData::setSeedingMode(hash, true);
|
||||||
#endif
|
#endif
|
||||||
@@ -273,7 +264,7 @@ void torrentCreatorThread::run() {
|
|||||||
// Set qBittorrent as creator and add user comment to
|
// Set qBittorrent as creator and add user comment to
|
||||||
// torrent_info structure
|
// torrent_info structure
|
||||||
t.set_creator(creator_str);
|
t.set_creator(creator_str);
|
||||||
t.set_comment((const char*)comment.toUtf8());
|
t.set_comment((const char*)comment.toLocal8Bit());
|
||||||
// Is private ?
|
// Is private ?
|
||||||
t.set_priv(is_private);
|
t.set_priv(is_private);
|
||||||
if(abort) return;
|
if(abort) return;
|
||||||
|
|||||||
@@ -53,49 +53,34 @@ public:
|
|||||||
setFixedHeight(BAR_HEIGHT);
|
setFixedHeight(BAR_HEIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setProgress(const bitfield &pieces, const bitfield &downloading_pieces) {
|
void setProgress(bitfield pieces) {
|
||||||
if(pieces.empty()) {
|
if(pieces.empty()) {
|
||||||
// Empty bar
|
// Empty bar
|
||||||
QPixmap pix = QPixmap(1, 1);
|
QPixmap pix = QPixmap(1, 1);
|
||||||
pix.fill();
|
pix.fill();
|
||||||
pixmap = pix;
|
pixmap = pix;
|
||||||
} else {
|
} else {
|
||||||
const int nb_pieces = pieces.size();
|
int nb_pieces = pieces.size();
|
||||||
// Reduce the number of pieces before creating the pixmap
|
// Reduce the number of pieces before creating the pixmap
|
||||||
// otherwise it can crash when there are too many pieces
|
// otherwise it can crash when there are too many pieces
|
||||||
if(nb_pieces > width()) {
|
if(nb_pieces > width()) {
|
||||||
const int ratio = floor(nb_pieces/(double)width());
|
int ratio = floor(nb_pieces/(double)width());
|
||||||
std::vector<bool> scaled_pieces;
|
QVector<bool> scaled_pieces;
|
||||||
std::vector<bool> scaled_downloading;
|
|
||||||
for(int i=0; i<nb_pieces; i+= ratio) {
|
for(int i=0; i<nb_pieces; i+= ratio) {
|
||||||
bool have = true;
|
bool have = true;
|
||||||
for(int j=i; j<qMin(i+ratio, nb_pieces); ++j) {
|
for(int j=i; j<qMin(i+ratio, nb_pieces); ++j) {
|
||||||
if(!pieces[i]) { have = false; break; }
|
if(!pieces[i]) { have = false; break; }
|
||||||
}
|
}
|
||||||
scaled_pieces.push_back(have);
|
scaled_pieces << have;
|
||||||
if(have) {
|
|
||||||
scaled_downloading.push_back(false);
|
|
||||||
} else {
|
|
||||||
bool downloading = false;
|
|
||||||
for(int j=i; j<qMin(i+ratio, nb_pieces); ++j) {
|
|
||||||
if(downloading_pieces[i]) { downloading = true; break; }
|
|
||||||
}
|
|
||||||
scaled_downloading.push_back(downloading);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
QPixmap pix = QPixmap(scaled_pieces.size(), 1);
|
QPixmap pix = QPixmap(scaled_pieces.size(), 1);
|
||||||
pix.fill();
|
pix.fill();
|
||||||
QPainter painter(&pix);
|
QPainter painter(&pix);
|
||||||
for(uint i=0; i<scaled_pieces.size(); ++i) {
|
for(int i=0; i<scaled_pieces.size(); ++i) {
|
||||||
if(scaled_pieces[i]) {
|
if(scaled_pieces[i])
|
||||||
painter.setPen(Qt::blue);
|
painter.setPen(Qt::blue);
|
||||||
} else {
|
else
|
||||||
if(scaled_downloading[i]) {
|
painter.setPen(Qt::white);
|
||||||
painter.setPen(Qt::yellow);
|
|
||||||
} else {
|
|
||||||
painter.setPen(Qt::white);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
painter.drawPoint(i,0);
|
painter.drawPoint(i,0);
|
||||||
}
|
}
|
||||||
pixmap = pix;
|
pixmap = pix;
|
||||||
@@ -104,15 +89,10 @@ public:
|
|||||||
pix.fill();
|
pix.fill();
|
||||||
QPainter painter(&pix);
|
QPainter painter(&pix);
|
||||||
for(uint i=0; i<pieces.size(); ++i) {
|
for(uint i=0; i<pieces.size(); ++i) {
|
||||||
if(pieces[i]) {
|
if(pieces[i])
|
||||||
painter.setPen(Qt::blue);
|
painter.setPen(Qt::blue);
|
||||||
} else {
|
else
|
||||||
if(downloading_pieces[i]) {
|
painter.setPen(Qt::white);
|
||||||
painter.setPen(Qt::yellow);
|
|
||||||
} else {
|
|
||||||
painter.setPen(Qt::white);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
painter.drawPoint(i,0);
|
painter.drawPoint(i,0);
|
||||||
}
|
}
|
||||||
pixmap = pix;
|
pixmap = pix;
|
||||||
|
|||||||
@@ -42,9 +42,6 @@ enum ProxyType {HTTP=1, SOCKS5=2, HTTP_PW=3, SOCKS5_PW=4, SOCKS4=5};
|
|||||||
downloadThread::downloadThread(QObject* parent) : QObject(parent) {
|
downloadThread::downloadThread(QObject* parent) : QObject(parent) {
|
||||||
networkManager = new QNetworkAccessManager(this);
|
networkManager = new QNetworkAccessManager(this);
|
||||||
connect(networkManager, SIGNAL(finished (QNetworkReply*)), this, SLOT(processDlFinished(QNetworkReply*)));
|
connect(networkManager, SIGNAL(finished (QNetworkReply*)), this, SLOT(processDlFinished(QNetworkReply*)));
|
||||||
#ifndef QT_NO_OPENSSL
|
|
||||||
connect(networkManager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)), this, SLOT(ignoreSslErrors(QNetworkReply*,QList<QSslError>)));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadThread::~downloadThread(){
|
downloadThread::~downloadThread(){
|
||||||
@@ -54,7 +51,7 @@ downloadThread::~downloadThread(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void downloadThread::processDlFinished(QNetworkReply* reply) {
|
void downloadThread::processDlFinished(QNetworkReply* reply) {
|
||||||
QString url = reply->url().toEncoded().data();
|
QString url = reply->url().toString();
|
||||||
if(reply->error() != QNetworkReply::NoError) {
|
if(reply->error() != QNetworkReply::NoError) {
|
||||||
// Failure
|
// Failure
|
||||||
emit downloadFailure(url, errorCodeToString(reply->error()));
|
emit downloadFailure(url, errorCodeToString(reply->error()));
|
||||||
@@ -73,27 +70,24 @@ void downloadThread::processDlFinished(QNetworkReply* reply) {
|
|||||||
}
|
}
|
||||||
// Success
|
// Success
|
||||||
QString filePath;
|
QString filePath;
|
||||||
QTemporaryFile *tmpfile = new QTemporaryFile;
|
QTemporaryFile tmpfile;
|
||||||
tmpfile->setAutoRemove(false);
|
tmpfile.setAutoRemove(false);
|
||||||
if (tmpfile->open()) {
|
if (tmpfile.open()) {
|
||||||
filePath = tmpfile->fileName();
|
filePath = tmpfile.fileName();
|
||||||
qDebug("Temporary filename is: %s", qPrintable(filePath));
|
qDebug("Temporary filename is: %s", qPrintable(filePath));
|
||||||
if(reply->open(QIODevice::ReadOnly)) {
|
if(reply->open(QIODevice::ReadOnly)) {
|
||||||
// TODO: Support GZIP compression
|
// TODO: Support GZIP compression
|
||||||
tmpfile->write(reply->readAll());
|
tmpfile.write(reply->readAll());
|
||||||
reply->close();
|
reply->close();
|
||||||
tmpfile->close();
|
tmpfile.close();
|
||||||
delete tmpfile;
|
|
||||||
// Send finished signal
|
// Send finished signal
|
||||||
emit downloadFinished(url, filePath);
|
emit downloadFinished(url, filePath);
|
||||||
} else {
|
} else {
|
||||||
// Error when reading the request
|
// Error when reading the request
|
||||||
tmpfile->close();
|
tmpfile.close();
|
||||||
delete tmpfile;
|
|
||||||
emit downloadFailure(url, tr("I/O Error"));
|
emit downloadFailure(url, tr("I/O Error"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
delete tmpfile;
|
|
||||||
emit downloadFailure(url, tr("I/O Error"));
|
emit downloadFailure(url, tr("I/O Error"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -219,11 +213,3 @@ QString downloadThread::errorCodeToString(QNetworkReply::NetworkError status) {
|
|||||||
return tr("Unknown error");
|
return tr("Unknown error");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_OPENSSL
|
|
||||||
void downloadThread::ignoreSslErrors(QNetworkReply* reply,QList<QSslError> errors) {
|
|
||||||
Q_UNUSED(errors)
|
|
||||||
// Ignore all SSL errors
|
|
||||||
reply->ignoreSslErrors();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QSslError>
|
|
||||||
|
|
||||||
class QNetworkAccessManager;
|
class QNetworkAccessManager;
|
||||||
|
|
||||||
@@ -63,9 +62,6 @@ protected:
|
|||||||
protected slots:
|
protected slots:
|
||||||
void processDlFinished(QNetworkReply* reply);
|
void processDlFinished(QNetworkReply* reply);
|
||||||
void checkDownloadSize(qint64 bytesReceived, qint64 bytesTotal);
|
void checkDownloadSize(qint64 bytesReceived, qint64 bytesTotal);
|
||||||
#ifndef QT_NO_OPENSSL
|
|
||||||
void ignoreSslErrors(QNetworkReply*,QList<QSslError>);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -125,17 +125,18 @@ void engineSelectDlg::toggleEngineState(QTreeWidgetItem *item, int) {
|
|||||||
|
|
||||||
void engineSelectDlg::displayContextMenu(const QPoint&) {
|
void engineSelectDlg::displayContextMenu(const QPoint&) {
|
||||||
QMenu myContextMenu(this);
|
QMenu myContextMenu(this);
|
||||||
|
QModelIndex index;
|
||||||
// Enable/disable pause/start action given the DL state
|
// Enable/disable pause/start action given the DL state
|
||||||
QList<QTreeWidgetItem *> items = pluginsTree->selectedItems();
|
QList<QTreeWidgetItem *> items = pluginsTree->selectedItems();
|
||||||
bool has_enable = false, has_disable = false;
|
bool has_enable = false, has_disable = false;
|
||||||
QTreeWidgetItem *item;
|
QTreeWidgetItem *item;
|
||||||
foreach(item, items) {
|
foreach(item, items) {
|
||||||
QString id = item->text(ENGINE_ID);
|
QString id = item->text(ENGINE_ID);
|
||||||
if(supported_engines->value(id)->isEnabled() && !has_disable) {
|
if(supported_engines->value(id)->isEnabled() and !has_disable) {
|
||||||
myContextMenu.addAction(actionDisable);
|
myContextMenu.addAction(actionDisable);
|
||||||
has_disable = true;
|
has_disable = true;
|
||||||
}
|
}
|
||||||
if(!supported_engines->value(id)->isEnabled() && !has_enable) {
|
if(!supported_engines->value(id)->isEnabled() and !has_enable) {
|
||||||
myContextMenu.addAction(actionEnable);
|
myContextMenu.addAction(actionEnable);
|
||||||
has_enable = true;
|
has_enable = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,10 +29,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <libtorrent/version.hpp>
|
|
||||||
#include "eventmanager.h"
|
#include "eventmanager.h"
|
||||||
#include "bittorrent.h"
|
#include "bittorrent.h"
|
||||||
#include "scannedfoldersmodel.h"
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "preferences.h"
|
#include "preferences.h"
|
||||||
//#include "proplistdelegate.h"
|
//#include "proplistdelegate.h"
|
||||||
@@ -61,7 +59,7 @@ QList<QVariantMap> EventManager::getPropTrackersInfo(QString hash) const {
|
|||||||
tracker["url"] = tracker_url;
|
tracker["url"] = tracker_url;
|
||||||
TrackerInfos data = trackers_data.value(tracker_url, TrackerInfos(tracker_url));
|
TrackerInfos data = trackers_data.value(tracker_url, TrackerInfos(tracker_url));
|
||||||
QString error_message = data.last_message.trimmed();
|
QString error_message = data.last_message.trimmed();
|
||||||
#if LIBTORRENT_VERSION_MINOR > 14
|
#ifdef LIBTORRENT_0_15
|
||||||
if(it->verified) {
|
if(it->verified) {
|
||||||
tracker["status"] = tr("Working");
|
tracker["status"] = tr("Working");
|
||||||
} else {
|
} else {
|
||||||
@@ -105,7 +103,7 @@ QList<QVariantMap> EventManager::getPropFilesInfo(QString hash) const {
|
|||||||
int i=0;
|
int i=0;
|
||||||
for(fi=t.begin_files(); fi != t.end_files(); fi++) {
|
for(fi=t.begin_files(); fi != t.end_files(); fi++) {
|
||||||
QVariantMap file;
|
QVariantMap file;
|
||||||
QString path = QDir::cleanPath(misc::toQStringU(fi->path.string()));
|
QString path = QDir::cleanPath(misc::toQString(fi->path.string()));
|
||||||
QString name = path.split('/').last();
|
QString name = path.split('/').last();
|
||||||
file["name"] = name;
|
file["name"] = name;
|
||||||
file["size"] = misc::friendlyUnit((double)fi->size);
|
file["size"] = misc::friendlyUnit((double)fi->size);
|
||||||
@@ -131,33 +129,10 @@ void EventManager::setGlobalPreferences(QVariantMap m) const {
|
|||||||
Preferences::setTempPathEnabled(m["temp_path_enabled"].toBool());
|
Preferences::setTempPathEnabled(m["temp_path_enabled"].toBool());
|
||||||
if(m.contains("temp_path"))
|
if(m.contains("temp_path"))
|
||||||
Preferences::setTempPath(m["temp_path"].toString());
|
Preferences::setTempPath(m["temp_path"].toString());
|
||||||
if(m.contains("scan_dirs") && m.contains("download_in_scan_dirs")) {
|
if(m.contains("scan_dirs"))
|
||||||
QVariantList download_at_path_tmp = m["download_in_scan_dirs"].toList();
|
Preferences::setScanDirs(m["scan_dirs"].toStringList());
|
||||||
QList<bool> download_at_path;
|
if(m.contains("download_in_scan_dirs"))
|
||||||
foreach(QVariant var, download_at_path_tmp) {
|
Preferences::setDownloadInScanDirs(m["download_in_scan_dirs"].toList());
|
||||||
download_at_path << var.toBool();
|
|
||||||
}
|
|
||||||
QStringList old_folders = Preferences::getScanDirs();
|
|
||||||
QStringList new_folders = m["scan_dirs"].toStringList();
|
|
||||||
if(download_at_path.size() == new_folders.size()) {
|
|
||||||
Preferences::setScanDirs(new_folders);
|
|
||||||
Preferences::setDownloadInScanDirs(download_at_path);
|
|
||||||
foreach(const QString &old_folder, old_folders) {
|
|
||||||
// Update deleted folders
|
|
||||||
if(!new_folders.contains(old_folder)) {
|
|
||||||
BTSession->getScanFoldersModel()->removePath(old_folder);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int i = 0;
|
|
||||||
foreach(const QString &new_folder, new_folders) {
|
|
||||||
// Update new folders
|
|
||||||
if(!old_folders.contains(new_folder)) {
|
|
||||||
BTSession->getScanFoldersModel()->addPath(new_folder, download_at_path.at(i));
|
|
||||||
}
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(m.contains("export_dir"))
|
if(m.contains("export_dir"))
|
||||||
Preferences::setExportDir(m["export_dir"].toString());
|
Preferences::setExportDir(m["export_dir"].toString());
|
||||||
if(m.contains("preallocate_all"))
|
if(m.contains("preallocate_all"))
|
||||||
@@ -170,7 +145,7 @@ void EventManager::setGlobalPreferences(QVariantMap m) const {
|
|||||||
Preferences::setMaxActiveTorrents(m["max_active_torrents"].toInt());
|
Preferences::setMaxActiveTorrents(m["max_active_torrents"].toInt());
|
||||||
if(m.contains("max_active_uploads"))
|
if(m.contains("max_active_uploads"))
|
||||||
Preferences::setMaxActiveUploads(m["max_active_uploads"].toInt());
|
Preferences::setMaxActiveUploads(m["max_active_uploads"].toInt());
|
||||||
#if LIBTORRENT_VERSION_MINOR > 14
|
#ifdef LIBTORRENT_0_15
|
||||||
if(m.contains("incomplete_files_ext"))
|
if(m.contains("incomplete_files_ext"))
|
||||||
Preferences::useIncompleteFilesExtension(m["incomplete_files_ext"].toBool());
|
Preferences::useIncompleteFilesExtension(m["incomplete_files_ext"].toBool());
|
||||||
#endif
|
#endif
|
||||||
@@ -194,10 +169,6 @@ void EventManager::setGlobalPreferences(QVariantMap m) const {
|
|||||||
// Bittorrent
|
// Bittorrent
|
||||||
if(m.contains("dht"))
|
if(m.contains("dht"))
|
||||||
Preferences::setDHTEnabled(m["dht"].toBool());
|
Preferences::setDHTEnabled(m["dht"].toBool());
|
||||||
if(m.contains("dhtSameAsBT"))
|
|
||||||
Preferences::setDHTPortSameAsBT(m["dhtSameAsBT"].toBool());
|
|
||||||
if(m.contains("dht_port"))
|
|
||||||
Preferences::setDHTPort(m["dht_port"].toInt());
|
|
||||||
if(m.contains("pex"))
|
if(m.contains("pex"))
|
||||||
Preferences::setPeXEnabled(m["pex"].toBool());
|
Preferences::setPeXEnabled(m["pex"].toBool());
|
||||||
qDebug("Pex support: %d", (int)m["pex"].toBool());
|
qDebug("Pex support: %d", (int)m["pex"].toBool());
|
||||||
@@ -261,11 +232,7 @@ QVariantMap EventManager::getGlobalPreferences() const {
|
|||||||
data["temp_path_enabled"] = Preferences::isTempPathEnabled();
|
data["temp_path_enabled"] = Preferences::isTempPathEnabled();
|
||||||
data["temp_path"] = Preferences::getTempPath();
|
data["temp_path"] = Preferences::getTempPath();
|
||||||
data["scan_dirs"] = Preferences::getScanDirs();
|
data["scan_dirs"] = Preferences::getScanDirs();
|
||||||
QVariantList var_list;
|
data["download_in_scan_dirs"] = Preferences::getDownloadInScanDirs();
|
||||||
foreach(bool b, Preferences::getDownloadInScanDirs()) {
|
|
||||||
var_list << b;
|
|
||||||
}
|
|
||||||
data["download_in_scan_dirs"] = var_list;
|
|
||||||
data["export_dir_enabled"] = Preferences::isTorrentExportEnabled();
|
data["export_dir_enabled"] = Preferences::isTorrentExportEnabled();
|
||||||
data["export_dir"] = Preferences::getExportDir();
|
data["export_dir"] = Preferences::getExportDir();
|
||||||
data["preallocate_all"] = Preferences::preAllocateAllFiles();
|
data["preallocate_all"] = Preferences::preAllocateAllFiles();
|
||||||
@@ -273,7 +240,7 @@ QVariantMap EventManager::getGlobalPreferences() const {
|
|||||||
data["max_active_downloads"] = Preferences::getMaxActiveDownloads();
|
data["max_active_downloads"] = Preferences::getMaxActiveDownloads();
|
||||||
data["max_active_torrents"] = Preferences::getMaxActiveTorrents();
|
data["max_active_torrents"] = Preferences::getMaxActiveTorrents();
|
||||||
data["max_active_uploads"] = Preferences::getMaxActiveUploads();
|
data["max_active_uploads"] = Preferences::getMaxActiveUploads();
|
||||||
#if LIBTORRENT_VERSION_MINOR > 14
|
#ifdef LIBTORRENT_0_15
|
||||||
data["incomplete_files_ext"] = Preferences::useIncompleteFilesExtension();
|
data["incomplete_files_ext"] = Preferences::useIncompleteFilesExtension();
|
||||||
#endif
|
#endif
|
||||||
// Connection
|
// Connection
|
||||||
@@ -287,8 +254,6 @@ QVariantMap EventManager::getGlobalPreferences() const {
|
|||||||
data["max_uploads_per_torrent"] = Preferences::getMaxUploadsPerTorrent();
|
data["max_uploads_per_torrent"] = Preferences::getMaxUploadsPerTorrent();
|
||||||
// Bittorrent
|
// Bittorrent
|
||||||
data["dht"] = Preferences::isDHTEnabled();
|
data["dht"] = Preferences::isDHTEnabled();
|
||||||
data["dhtSameAsBT"] = Preferences::isDHTPortSameAsBT();
|
|
||||||
data["dht_port"] = Preferences::getDHTPort();
|
|
||||||
data["pex"] = Preferences::isPeXEnabled();
|
data["pex"] = Preferences::isPeXEnabled();
|
||||||
data["lsd"] = Preferences::isLSDEnabled();
|
data["lsd"] = Preferences::isLSDEnabled();
|
||||||
data["encryption"] = Preferences::getEncryptionSetting();
|
data["encryption"] = Preferences::getEncryptionSetting();
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ protected slots:
|
|||||||
default_path = QDir::homePath();
|
default_path = QDir::homePath();
|
||||||
}
|
}
|
||||||
QString dir = QFileDialog::getExistingDirectory(this, tr("Choose save path"), QDir::homePath());
|
QString dir = QFileDialog::getExistingDirectory(this, tr("Choose save path"), QDir::homePath());
|
||||||
if(!dir.isNull() && QDir(dir).exists()) {
|
if(!dir.isNull() and QDir(dir).exists()) {
|
||||||
savepath_line->setText(dir);
|
savepath_line->setText(dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
#define FILESYSTEMWATCHER_H
|
#define FILESYSTEMWATCHER_H
|
||||||
|
|
||||||
#include <QFileSystemWatcher>
|
#include <QFileSystemWatcher>
|
||||||
#include <QDir>
|
|
||||||
|
|
||||||
#ifndef Q_WS_WIN
|
#ifndef Q_WS_WIN
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
#include <QDir>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
@@ -180,7 +180,6 @@ protected slots:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void scanNetworkFolders() {
|
void scanNetworkFolders() {
|
||||||
#ifndef Q_WS_WIN
|
|
||||||
qDebug("scanNetworkFolders() called");
|
qDebug("scanNetworkFolders() called");
|
||||||
QStringList torrents;
|
QStringList torrents;
|
||||||
// Network folders scan
|
// Network folders scan
|
||||||
@@ -193,7 +192,6 @@ protected slots:
|
|||||||
qDebug("The following files are being reported: %s", qPrintable(torrents.join("\n")));
|
qDebug("The following files are being reported: %s", qPrintable(torrents.join("\n")));
|
||||||
emit torrentsAdded(torrents);
|
emit torrentsAdded(torrents);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|||||||
11
src/geoip.h
@@ -68,19 +68,13 @@ protected:
|
|||||||
// Create geoip folder is necessary
|
// Create geoip folder is necessary
|
||||||
QDir gfolder(geoipFolder(false));
|
QDir gfolder(geoipFolder(false));
|
||||||
if(!gfolder.exists()) {
|
if(!gfolder.exists()) {
|
||||||
if(!gfolder.mkpath(geoipFolder(false))) {
|
if(!gfolder.mkpath(geoipFolder(false))) return;
|
||||||
std::cerr << "Failed to create geoip folder at " << qPrintable(geoipFolder(false)) << std::endl;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Remove destination files
|
// Remove destination files
|
||||||
if(QFile::exists(geoipDBpath(false)))
|
if(QFile::exists(geoipDBpath(false)))
|
||||||
QFile::remove(geoipDBpath(false));
|
QFile::remove(geoipDBpath(false));
|
||||||
// Copy from executable to hard disk
|
// Copy from executable to hard disk
|
||||||
qDebug("%s -> %s", qPrintable(geoipDBpath(true)), qPrintable(geoipDBpath(false)));
|
QFile::copy(geoipDBpath(true), geoipDBpath(false));
|
||||||
if(!QFile::copy(geoipDBpath(true), geoipDBpath(false))) {
|
|
||||||
std::cerr << "ERROR: Failed to copy geoip.dat from executable to hard disk" << std::endl;
|
|
||||||
}
|
|
||||||
qDebug("Local Geoip database was updated");
|
qDebug("Local Geoip database was updated");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -194,7 +188,6 @@ public:
|
|||||||
if(iso[1] == 'S') return QIcon(":/Icons/flags/serbia.png");
|
if(iso[1] == 'S') return QIcon(":/Icons/flags/serbia.png");
|
||||||
break;
|
break;
|
||||||
case 'S':
|
case 'S':
|
||||||
if(iso[1] == 'A') return QIcon(":/Icons/flags/saoudi_arabia.png");
|
|
||||||
if(iso[1] == 'E') return QIcon(":/Icons/flags/sweden.png");
|
if(iso[1] == 'E') return QIcon(":/Icons/flags/sweden.png");
|
||||||
if(iso[1] == 'K') return QIcon(":/Icons/flags/slovakia.png");
|
if(iso[1] == 'K') return QIcon(":/Icons/flags/slovakia.png");
|
||||||
if(iso[1] == 'G') return QIcon(":/Icons/flags/singapore.png");
|
if(iso[1] == 'G') return QIcon(":/Icons/flags/singapore.png");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource>
|
<qresource prefix="/" >
|
||||||
<file>geoip/GeoIP.dat</file>
|
<file>geoip/GeoIP.dat</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -33,10 +33,12 @@
|
|||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
#include <QLocalServer>
|
||||||
|
#include <QLocalSocket>
|
||||||
#include "preferences.h"
|
#include "preferences.h"
|
||||||
#include "bittorrent.h"
|
#include "bittorrent.h"
|
||||||
|
|
||||||
class HeadlessLoader: public QObject {
|
class HeadlessLoader: QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -50,6 +52,20 @@ public:
|
|||||||
BTSession->startUpTorrents();
|
BTSession->startUpTorrents();
|
||||||
// Process command line parameters
|
// Process command line parameters
|
||||||
processParams(torrentCmdLine);
|
processParams(torrentCmdLine);
|
||||||
|
// Use a tcp server to allow only one instance of qBittorrent
|
||||||
|
localServer = new QLocalServer();
|
||||||
|
const QString &uid = QString::number(getuid());
|
||||||
|
#ifdef Q_WS_X11
|
||||||
|
if(QFile::exists(QDir::tempPath()+QDir::separator()+QString("qBittorrent-")+uid)) {
|
||||||
|
// Socket was not closed cleanly
|
||||||
|
std::cerr << "Warning: Local domain socket was not closed cleanly, deleting file..." << std::endl;
|
||||||
|
QFile::remove(QDir::tempPath()+QDir::separator()+QString("qBittorrent-")+uid);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (!localServer->listen("qBittorrent-"+uid)) {
|
||||||
|
std::cerr << "Couldn't create socket, single instance mode won't work..." << std::endl;
|
||||||
|
}
|
||||||
|
connect(localServer, SIGNAL(newConnection()), this, SLOT(acceptConnection()));
|
||||||
// Display some information to the user
|
// Display some information to the user
|
||||||
std::cout << std::endl << "******** " << qPrintable(tr("Information")) << " ********" << std::endl;
|
std::cout << std::endl << "******** " << qPrintable(tr("Information")) << " ********" << std::endl;
|
||||||
std::cout << qPrintable(tr("To control qBittorrent, access the Web UI at http://localhost:%1").arg(QString::number(Preferences::getWebUiPort()))) << std::endl;
|
std::cout << qPrintable(tr("To control qBittorrent, access the Web UI at http://localhost:%1").arg(QString::number(Preferences::getWebUiPort()))) << std::endl;
|
||||||
@@ -61,6 +77,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
~HeadlessLoader() {
|
~HeadlessLoader() {
|
||||||
|
delete localServer;
|
||||||
delete BTSession;
|
delete BTSession;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,10 +92,6 @@ public slots:
|
|||||||
std::cout << qPrintable(msg) << std::endl;
|
std::cout << qPrintable(msg) << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void processParams(const QString& params_str) {
|
|
||||||
processParams(params_str.split(" ", QString::SkipEmptyParts));
|
|
||||||
}
|
|
||||||
|
|
||||||
// As program parameters, we can get paths or urls.
|
// As program parameters, we can get paths or urls.
|
||||||
// This function parse the parameters and call
|
// This function parse the parameters and call
|
||||||
// the right addTorrent function, considering
|
// the right addTorrent function, considering
|
||||||
@@ -86,6 +99,7 @@ public slots:
|
|||||||
void processParams(const QStringList& params) {
|
void processParams(const QStringList& params) {
|
||||||
foreach(QString param, params) {
|
foreach(QString param, params) {
|
||||||
param = param.trimmed();
|
param = param.trimmed();
|
||||||
|
if(param.startsWith("--")) continue;
|
||||||
if(param.startsWith(QString::fromUtf8("http://"), Qt::CaseInsensitive) || param.startsWith(QString::fromUtf8("ftp://"), Qt::CaseInsensitive) || param.startsWith(QString::fromUtf8("https://"), Qt::CaseInsensitive)) {
|
if(param.startsWith(QString::fromUtf8("http://"), Qt::CaseInsensitive) || param.startsWith(QString::fromUtf8("ftp://"), Qt::CaseInsensitive) || param.startsWith(QString::fromUtf8("https://"), Qt::CaseInsensitive)) {
|
||||||
BTSession->downloadFromUrl(param);
|
BTSession->downloadFromUrl(param);
|
||||||
}else{
|
}else{
|
||||||
@@ -98,7 +112,26 @@ public slots:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void acceptConnection() {
|
||||||
|
QLocalSocket *clientConnection = localServer->nextPendingConnection();
|
||||||
|
connect(clientConnection, SIGNAL(disconnected()), this, SLOT(readParamsOnSocket()));
|
||||||
|
qDebug("accepted connection from another instance");
|
||||||
|
}
|
||||||
|
|
||||||
|
void readParamsOnSocket() {
|
||||||
|
QLocalSocket *clientConnection = static_cast<QLocalSocket*>(sender());
|
||||||
|
if(clientConnection) {
|
||||||
|
const QByteArray ¶ms = clientConnection->readAll();
|
||||||
|
if(!params.isEmpty()) {
|
||||||
|
processParams(QString(params).split("\n"));
|
||||||
|
qDebug("Received parameters from another instance");
|
||||||
|
}
|
||||||
|
clientConnection->deleteLater();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QLocalServer *localServer;
|
||||||
Bittorrent *BTSession;
|
Bittorrent *BTSession;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||