1
mirror of https://github.com/qbittorrent/qBittorrent synced 2025-10-23 22:32:16 +02:00

Compare commits

..

1 Commits

Author SHA1 Message Date
Christophe Dumez
3f22122348 Tagged v2.2.6 release 2010-04-18 14:08:36 +00:00
150 changed files with 9711 additions and 17055 deletions

View File

@@ -3,19 +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>
* Silvan Scherrer <silvan.scherrer@aroa.ch>
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
@@ -73,7 +66,6 @@ Translations authors:
- 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)

View File

@@ -1,53 +1,3 @@
* Wed Jul 21 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.11
- BUGFIX: Fix parsing of program arguments with spaces
- BUGFIX: Fix possible crash when using alternative speed limits (#598272)
- BUGFIX: Fix possible crash on exit when using
- BUGFIX: Require GTK+ headers on compilation when libnotify is used
- BUGFIX: Added configure flag to avoid using the shipped qtsingleapplication
* Wed Jun 23 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.10
- BUGFIX: Fix Web UI in qBittorrent nox version
- BUGFIX: Improved ETA display (more user friendly)
- BUGFIX: Fix possible compilation errors with libtorrent v0.15
- BUGFIX: Fix minor issues in torrent creation tool
- BUGFIX: Use checkable actions to avoid issues on systems hiding menu icons (e.g. recent Gnome)
- BUGFIX: Use busy cursor for search plugin updates
- BUGFIX: Free disk space calculation now works if destination folder does not exist
- BUGFIX: Fix "append .!qB extension to incomplete files" feature
- BUGFIX: Several OS/2 fixes by Silvan Scherrer
- COSMETIC: Display "Alternative speed limits" button as pressed when enabled
* 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 * Sun Apr 18 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.6
- BUGFIX: Announce to all trackers at once - BUGFIX: Announce to all trackers at once
- BUGFIX: Added support for single-thread boost - BUGFIX: Added support for single-thread boost

99
configure vendored
View File

@@ -18,24 +18,15 @@ Main options:
--help This help text. --help This help text.
Dependency options: Dependency options:
--disable-gui Disable qBittorrent --disable-gui Disable qBittorrent Graphical user
Graphical user interface for interface for headless running
headless running --with-libboost-inc=[path] Path to libboost include files
--with-libboost-inc=[path] Path to libboost include --with-libboost-lib=[path] Path to libboost library files
files --disable-libnotify Disable use of libnotify
--with-libboost-lib=[path] Path to libboost library --disable-geoip-database Disable use of geoip-database
files --with-geoip-database-embedded Geoip Database will be embedded in
--disable-libnotify Disable use of libnotify qBittorrent executable (please follow
--disable-geoip-database Disable use of geoip-database instructions in src/geoip/README)
--with-geoip-database-embedded Geoip Database will be
embedded in qBittorrent
executable (please follow
instructions in
src/geoip/README)
--disable-qtsingleapplication Disable use of libboost
--with-qtsingleapplication=[system|shipped] Use the shipped
qtsingleapplication library
or the system one
EOT EOT
} }
@@ -182,16 +173,6 @@ while [ $# -gt 0 ]; do
shift shift
;; ;;
--disable-qtsingleapplication)
QC_DISABLE_qtsingleapplication="Y"
shift
;;
--with-qtsingleapplication=*)
QC_WITH_QTSINGLEAPPLICATION=$optarg
shift
;;
--verbose) --verbose)
QC_VERBOSE="Y" QC_VERBOSE="Y"
shift shift
@@ -219,8 +200,6 @@ 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
echo QC_DISABLE_qtsingleapplication=$QC_DISABLE_qtsingleapplication
echo QC_WITH_QTSINGLEAPPLICATION=$QC_WITH_QTSINGLEAPPLICATION
echo echo
fi fi
@@ -376,12 +355,27 @@ 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(!libs.isEmpty())
// conf->addLib(libs);
if(conf->findPkgConfig("libtorrent-rasterbar", mode, adv_ver, &version, &incs, &libs, &other)) {
//printf("\nWarning: libtorrent-rasterbar v%s was detected. 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());
//libcrypto
if(conf->getenv("QC_DISABLE_GUI").isEmpty()) { if(conf->getenv("QC_DISABLE_GUI").isEmpty()) {
conf->addLib("-lcrypto"); conf->addLib("-lcrypto");
} }
@@ -550,21 +544,10 @@ public:
} else { } else {
return false; return false;
} }
QStringList incs3;
QString req_ver3 = "2.0";
QString version3, libs3, other3;
if(conf->findPkgConfig("gtk+-2.0", mode, req_ver3, &version3, &incs3, &libs3, &other3)) {
for(int n = 0; n < incs3.count(); ++n)
conf->addIncludePath(incs3[n]);
if(!libs3.isEmpty())
conf->addLib(libs3);
} else {
return false;
}
} else { } else {
return false; return false;
} }
return true; return true;
} }
}; };
@@ -606,33 +589,6 @@ public:
#endif #endif
} }
}; };
#line 1 "qtsingleapplication.qcm"
/*
-----BEGIN QCMOD-----
name: libboost
arg: with-qtsingleapplication=[system|shipped], Use the shipped qtsingleapplication library or the system one
-----END QCMOD-----
*/
class qc_qtsingleapplication : public ConfObj
{
public:
qc_qtsingleapplication(Conf *c) : ConfObj(c) {}
QString name() const { return "qtsingleapplication library"; }
QString shortname() const { return "qtsingleapplication"; }
bool exec(){
QString s;
s = conf->getenv("QC_WITH_QTSINGLEAPPLICATION");
if(s.compare("system", Qt::CaseInsensitive) == 0) {
// System
conf->addDefine("USE_SYSTEM_QTSINGLEAPPLICATION");
printf(" [system] ");
} else {
printf(" [shipped] ");
}
return true;
}
};
EOT EOT
cat >$1/modules_new.cpp <<EOT cat >$1/modules_new.cpp <<EOT
@@ -654,9 +610,6 @@ cat >$1/modules_new.cpp <<EOT
o = new qc_geoip_database(conf); o = new qc_geoip_database(conf);
o->required = false; o->required = false;
o->disabled = false; o->disabled = false;
o = new qc_qtsingleapplication(conf);
o->required = false;
o->disabled = false;
EOT EOT
cat >$1/conf4.h <<EOT cat >$1/conf4.h <<EOT
@@ -1608,8 +1561,6 @@ 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
export QC_DISABLE_qtsingleapplication
export QC_WITH_QTSINGLEAPPLICATION
export QC_VERBOSE export QC_VERBOSE
rm -rf .qconftemp rm -rf .qconftemp
( (

View File

@@ -19,6 +19,4 @@
</dep> </dep>
<dep type='geoip-database'> <dep type='geoip-database'>
</dep> </dep>
<dep type='qtsingleapplication'>
</dep>
</qconf> </qconf>

View File

@@ -40,21 +40,10 @@ public:
} else { } else {
return false; return false;
} }
QStringList incs3;
QString req_ver3 = "2.0";
QString version3, libs3, other3;
if(conf->findPkgConfig("gtk+-2.0", mode, req_ver3, &version3, &incs3, &libs3, &other3)) {
for(int n = 0; n < incs3.count(); ++n)
conf->addIncludePath(incs3[n]);
if(!libs3.isEmpty())
conf->addLib(libs3);
} else {
return false;
}
} else { } else {
return false; return false;
} }
return true; return true;
} }
}; };

View File

@@ -13,12 +13,27 @@ 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(!libs.isEmpty())
// conf->addLib(libs);
if(conf->findPkgConfig("libtorrent-rasterbar", mode, adv_ver, &version, &incs, &libs, &other)) {
//printf("\nWarning: libtorrent-rasterbar v%s was detected. 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());
//libcrypto
if(conf->getenv("QC_DISABLE_GUI").isEmpty()) { if(conf->getenv("QC_DISABLE_GUI").isEmpty()) {
conf->addLib("-lcrypto"); conf->addLib("-lcrypto");
} }

File diff suppressed because it is too large Load Diff

View File

@@ -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,7 +111,6 @@ 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);
@@ -143,7 +144,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 +164,8 @@ private:
SearchEngine *searchEngine; SearchEngine *searchEngine;
// RSS // RSS
QPointer<RSSImp> rssWidget; QPointer<RSSImp> rssWidget;
// Misc
QLocalServer *localServer;
}; };
#endif #endif

View File

@@ -1,9 +1,8 @@
[Desktop Entry] [Desktop Entry]
Categories=Qt;Network;P2P; Categories=Qt;Network;P2P;
Comment=V2.2.11 Comment=V2.2.6
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 クライアント

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 79 KiB

View File

@@ -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.11</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>

View File

@@ -54,8 +54,8 @@ 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
@@ -68,7 +68,6 @@ class about : public QDialog, private Ui::AboutDlg{
- <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>\

View File

@@ -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};

File diff suppressed because it is too large Load Diff

View File

@@ -43,7 +43,6 @@
#include <QPointer> #include <QPointer>
#include <QTimer> #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 +63,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 +74,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
@@ -118,9 +117,6 @@ public:
bool useTemporaryFolder() const; bool useTemporaryFolder() const;
QString getDefaultSavePath() const; QString getDefaultSavePath() const;
ScanFoldersModel* getScanFoldersModel() const; ScanFoldersModel* getScanFoldersModel() const;
#if LIBTORRENT_VERSION_MINOR < 15
void saveDHTEntry();
#endif
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);
@@ -139,6 +135,9 @@ public slots:
void resumeTorrent(QString hash); void resumeTorrent(QString hash);
void resumeAllTorrents(); void resumeAllTorrents();
/* End Web UI */ /* End Web UI */
#ifndef LIBTORRENT_0_15
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 +163,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
@@ -250,7 +249,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;

View File

@@ -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>
@@ -68,7 +67,7 @@ createtorrent::createtorrent(QWidget *parent): QDialog(parent){
setAttribute(Qt::WA_DeleteOnClose); setAttribute(Qt::WA_DeleteOnClose);
setModal(true); setModal(true);
creatorThread = new torrentCreatorThread(this); creatorThread = new torrentCreatorThread(this);
connect(creatorThread, SIGNAL(creationSuccess(QString, QString)), this, SLOT(handleCreationSuccess(QString, QString))); connect(creatorThread, SIGNAL(creationSuccess(QString, const char*)), this, SLOT(handleCreationSuccess(QString, const char*)));
connect(creatorThread, SIGNAL(creationFailure(QString)), this, SLOT(handleCreationFailure(QString))); connect(creatorThread, SIGNAL(creationFailure(QString)), this, SLOT(handleCreationFailure(QString)));
connect(creatorThread, SIGNAL(updateProgress(int)), this, SLOT(updateProgressBar(int))); connect(creatorThread, SIGNAL(updateProgress(int)), this, SLOT(updateProgressBar(int)));
path::default_name_check(no_check); path::default_name_check(no_check);
@@ -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())
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
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());
if(!file.isEmpty()) { if(!file.isEmpty())
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
file = file.replace("/", "\\");
#endif
textInputPath->setText(file); textInputPath->setText(file);
}
} }
void createtorrent::on_removeTracker_button_clicked() { void createtorrent::on_removeTracker_button_clicked() {
@@ -188,41 +179,28 @@ void createtorrent::on_createButton_clicked(){
} else { } else {
return; return;
} }
// Disable dialog
setEnabled(false);
// Set busy cursor
setCursor(QCursor(Qt::WaitCursor));
// Actually create the torrent
QStringList url_seeds = allItems(URLSeeds_list); QStringList url_seeds = allItems(URLSeeds_list);
QString comment = txt_comment->toPlainText(); QString comment = txt_comment->toPlainText();
creatorThread->create(input, destination, trackers, url_seeds, comment, check_private->isChecked(), getPieceSize()); creatorThread->create(input, destination, trackers, url_seeds, comment, check_private->isChecked(), getPieceSize());
} }
void createtorrent::handleCreationFailure(QString msg) { void createtorrent::handleCreationFailure(QString msg) {
// Enable dialog
setEnabled(true);
// Remove busy cursor
setCursor(QCursor(Qt::ArrowCursor));
QMessageBox::information(0, tr("Torrent creation"), tr("Torrent creation was unsuccessful, reason: %1").arg(msg)); QMessageBox::information(0, tr("Torrent creation"), tr("Torrent creation was unsuccessful, reason: %1").arg(msg));
} }
void createtorrent::handleCreationSuccess(QString path, QString branch_path) { void createtorrent::handleCreationSuccess(QString path, const char* branch_path) {
// Enable Dialog
setEnabled(true);
// Remove busy cursor
setCursor(QCursor(Qt::ArrowCursor));
if(checkStartSeeding->isChecked()) { if(checkStartSeeding->isChecked()) {
// 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, 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
@@ -232,18 +210,6 @@ void createtorrent::handleCreationSuccess(QString path, QString branch_path) {
close(); close();
} }
void createtorrent::on_cancelButton_clicked() {
// End torrent creation thread
if(creatorThread->isRunning()) {
creatorThread->abortCreation();
creatorThread->terminate();
// Wait for termination
creatorThread->wait();
}
// Close the dialog
reject();
}
void createtorrent::updateProgressBar(int progress) { void createtorrent::updateProgressBar(int progress) {
progressBar->setValue(progress); progressBar->setValue(progress);
} }
@@ -298,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;
@@ -306,7 +272,7 @@ void torrentCreatorThread::run() {
ofstream out(complete(path((const char*)save_path.toLocal8Bit())), std::ios_base::binary); ofstream out(complete(path((const char*)save_path.toLocal8Bit())), std::ios_base::binary);
bencode(std::ostream_iterator<char>(out), t.generate()); bencode(std::ostream_iterator<char>(out), t.generate());
emit updateProgress(100); emit updateProgress(100);
emit creationSuccess(save_path, QString::fromUtf8(full_path.branch_path().string().c_str())); emit creationSuccess(save_path, full_path.branch_path().string().c_str());
} }
catch (std::exception& e){ catch (std::exception& e){
emit creationFailure(QString::fromUtf8(e.what())); emit creationFailure(QString::fromUtf8(e.what()));

View File

@@ -58,14 +58,13 @@ class torrentCreatorThread : public QThread {
} }
void create(QString _input_path, QString _save_path, QStringList _trackers, QStringList _url_seeds, QString _comment, bool _is_private, int _piece_size); void create(QString _input_path, QString _save_path, QStringList _trackers, QStringList _url_seeds, QString _comment, bool _is_private, int _piece_size);
void sendProgressSignal(int progress); void sendProgressSignal(int progress);
void abortCreation() { abort = true; }
protected: protected:
void run(); void run();
signals: signals:
void creationFailure(QString msg); void creationFailure(QString msg);
void creationSuccess(QString path, QString branch_path); void creationSuccess(QString path, const char* branch_path);
signals: signals:
void updateProgress(int progress); void updateProgress(int progress);
@@ -88,7 +87,6 @@ class createtorrent : public QDialog, private Ui::createTorrentDialog{
public slots: public slots:
void updateProgressBar(int progress); void updateProgressBar(int progress);
void on_cancelButton_clicked();
protected slots: protected slots:
void on_createButton_clicked(); void on_createButton_clicked();
@@ -99,7 +97,7 @@ class createtorrent : public QDialog, private Ui::createTorrentDialog{
void on_addURLSeed_button_clicked(); void on_addURLSeed_button_clicked();
void on_removeURLSeed_button_clicked(); void on_removeURLSeed_button_clicked();
void handleCreationFailure(QString msg); void handleCreationFailure(QString msg);
void handleCreationSuccess(QString path, QString branch_path); void handleCreationSuccess(QString path, const char* branch_path);
}; };
#endif #endif

View File

@@ -54,7 +54,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 +73,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"));
} }
} }

View File

@@ -84,7 +84,6 @@ void engineSelectDlg::dropEvent(QDropEvent *event) {
qDebug("dropped %s", qPrintable(file)); qDebug("dropped %s", qPrintable(file));
file = file.replace("file://", ""); file = file.replace("file://", "");
if(file.startsWith("http://", Qt::CaseInsensitive) || file.startsWith("https://", Qt::CaseInsensitive) || file.startsWith("ftp://", Qt::CaseInsensitive)) { if(file.startsWith("http://", Qt::CaseInsensitive) || file.startsWith("https://", Qt::CaseInsensitive) || file.startsWith("ftp://", Qt::CaseInsensitive)) {
setCursor(QCursor(Qt::WaitCursor));
downloader->downloadUrl(file); downloader->downloadUrl(file);
continue; continue;
} }
@@ -109,7 +108,6 @@ void engineSelectDlg::dragEnterEvent(QDragEnterEvent *event) {
void engineSelectDlg::on_updateButton_clicked() { void engineSelectDlg::on_updateButton_clicked() {
// Download version file from update server on sourceforge // Download version file from update server on sourceforge
setCursor(QCursor(Qt::WaitCursor));
downloader->downloadUrl(QString(UPDATE_URL)+"versions.txt"); downloader->downloadUrl(QString(UPDATE_URL)+"versions.txt");
} }
@@ -127,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;
} }
@@ -351,10 +350,8 @@ void engineSelectDlg::askForPluginUrl() {
QString url = QInputDialog::getText(this, tr("New search engine plugin URL"), QString url = QInputDialog::getText(this, tr("New search engine plugin URL"),
tr("URL:"), QLineEdit::Normal, tr("URL:"), QLineEdit::Normal,
"http://", &ok); "http://", &ok);
if (ok && !url.isEmpty()) { if (ok && !url.isEmpty())
setCursor(QCursor(Qt::WaitCursor));
downloader->downloadUrl(url); downloader->downloadUrl(url);
}
} }
void engineSelectDlg::askForLocalPlugin() { void engineSelectDlg::askForLocalPlugin() {
@@ -399,7 +396,6 @@ bool engineSelectDlg::parseVersionsFile(QString versions_file) {
if(isUpdateNeeded(plugin_name, version)) { if(isUpdateNeeded(plugin_name, version)) {
qDebug("Plugin: %s is outdated", qPrintable(plugin_name)); qDebug("Plugin: %s is outdated", qPrintable(plugin_name));
// Downloading update // Downloading update
setCursor(QCursor(Qt::WaitCursor));
downloader->downloadUrl(UPDATE_URL+plugin_name+".py"); downloader->downloadUrl(UPDATE_URL+plugin_name+".py");
//downloader->downloadUrl(UPDATE_URL+plugin_name+".png"); //downloader->downloadUrl(UPDATE_URL+plugin_name+".png");
updated = true; updated = true;
@@ -418,7 +414,6 @@ bool engineSelectDlg::parseVersionsFile(QString versions_file) {
} }
void engineSelectDlg::processDownloadedFile(QString url, QString filePath) { void engineSelectDlg::processDownloadedFile(QString url, QString filePath) {
setCursor(QCursor(Qt::ArrowCursor));
qDebug("engineSelectDlg received %s", qPrintable(url)); qDebug("engineSelectDlg received %s", qPrintable(url));
if(url.endsWith("favicon.ico", Qt::CaseInsensitive)){ if(url.endsWith("favicon.ico", Qt::CaseInsensitive)){
// Icon downloaded // Icon downloaded
@@ -460,7 +455,6 @@ void engineSelectDlg::processDownloadedFile(QString url, QString filePath) {
} }
void engineSelectDlg::handleDownloadFailure(QString url, QString reason) { void engineSelectDlg::handleDownloadFailure(QString url, QString reason) {
setCursor(QCursor(Qt::ArrowCursor));
if(url.endsWith("favicon.ico", Qt::CaseInsensitive)){ if(url.endsWith("favicon.ico", Qt::CaseInsensitive)){
qDebug("Could not download favicon: %s, reason: %s", qPrintable(url), qPrintable(reason)); qDebug("Could not download favicon: %s, reason: %s", qPrintable(url), qPrintable(reason));
return; return;

View File

@@ -29,7 +29,6 @@
*/ */
#include <libtorrent/version.hpp>
#include "eventmanager.h" #include "eventmanager.h"
#include "bittorrent.h" #include "bittorrent.h"
#include "scannedfoldersmodel.h" #include "scannedfoldersmodel.h"
@@ -61,7 +60,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 +104,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);
@@ -132,11 +131,7 @@ void EventManager::setGlobalPreferences(QVariantMap m) const {
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") && m.contains("download_in_scan_dirs")) {
QVariantList download_at_path_tmp = m["download_in_scan_dirs"].toList(); QVariantList download_at_path = m["download_in_scan_dirs"].toList();
QList<bool> download_at_path;
foreach(QVariant var, download_at_path_tmp) {
download_at_path << var.toBool();
}
QStringList old_folders = Preferences::getScanDirs(); QStringList old_folders = Preferences::getScanDirs();
QStringList new_folders = m["scan_dirs"].toStringList(); QStringList new_folders = m["scan_dirs"].toStringList();
if(download_at_path.size() == new_folders.size()) { if(download_at_path.size() == new_folders.size()) {
@@ -152,7 +147,7 @@ void EventManager::setGlobalPreferences(QVariantMap m) const {
foreach(const QString &new_folder, new_folders) { foreach(const QString &new_folder, new_folders) {
// Update new folders // Update new folders
if(!old_folders.contains(new_folder)) { if(!old_folders.contains(new_folder)) {
BTSession->getScanFoldersModel()->addPath(new_folder, download_at_path.at(i)); BTSession->getScanFoldersModel()->addPath(new_folder, download_at_path.at(i).toBool());
} }
++i; ++i;
} }
@@ -170,7 +165,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
@@ -261,11 +256,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 +264,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

View File

@@ -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);
} }
} }

View File

@@ -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:

View File

@@ -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");
} }
} }

View File

@@ -1,5 +1,5 @@
<RCC> <RCC>
<qresource> <qresource prefix="/" >
<file>geoip/GeoIP.dat</file> <file>geoip/GeoIP.dat</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@@ -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 &params = 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;
}; };

View File

@@ -155,7 +155,7 @@ void HttpConnection::respond() {
qDebug("client IP: %s (%d failed attempts)", qPrintable(peer_ip), nb_fail+1); qDebug("client IP: %s (%d failed attempts)", qPrintable(peer_ip), nb_fail+1);
// Return unauthorized header // Return unauthorized header
generator.setStatusLine(401, "Unauthorized"); generator.setStatusLine(401, "Unauthorized");
generator.setValue("WWW-Authenticate", "Digest realm=\""+QString(QBT_REALM)+"\", nonce=\""+parent->generateNonce()+"\", opaque=\""+parent->generateNonce()+"\", stale=\"false\", algorithm=\"MD5\", qop=\"auth\""); generator.setValue("WWW-Authenticate", "Digest realm=\""+QString(QBT_REALM)+"\", nonce=\""+parent->generateNonce()+"\", algorithm=\"MD5\", qop=\"auth\"");
write(); write();
return; return;
} }
@@ -237,7 +237,6 @@ void HttpConnection::respond() {
QFile file(url); QFile file(url);
if(!file.open(QIODevice::ReadOnly)) if(!file.open(QIODevice::ReadOnly))
{ {
qDebug("File %s was not found!", qPrintable(url));
respondNotFound(); respondNotFound();
return; return;
} }

View File

@@ -39,8 +39,7 @@ void HttpResponseGenerator::setMessage(const QByteArray message)
void HttpResponseGenerator::setMessage(const QString message) void HttpResponseGenerator::setMessage(const QString message)
{ {
// This must be UTF-8! setMessage(message.QString::toLocal8Bit());
setMessage(message.toUtf8());
} }
void HttpResponseGenerator::stripMessage() void HttpResponseGenerator::stripMessage()

View File

@@ -21,7 +21,6 @@
<file>lang/qbittorrent_pt_BR.qm</file> <file>lang/qbittorrent_pt_BR.qm</file>
<file>lang/qbittorrent_el.qm</file> <file>lang/qbittorrent_el.qm</file>
<file>lang/qbittorrent_ca.qm</file> <file>lang/qbittorrent_ca.qm</file>
<file>lang/qbittorrent_hr.qm</file>
<file>lang/qbittorrent_sr.qm</file> <file>lang/qbittorrent_sr.qm</file>
<file>lang/qbittorrent_hu.qm</file> <file>lang/qbittorrent_hu.qm</file>
<file>lang/qbittorrent_da.qm</file> <file>lang/qbittorrent_da.qm</file>

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

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