Commit 40db1cd7 authored by Cristian Greco's avatar Cristian Greco

Imported Upstream version 2.1.0~rc7

parent 60908cbe
......@@ -12,6 +12,10 @@ Code from other projects:
copyright: Malte Starostik <malte@kde.org>
license: LGPL
* files src/search_engine/socks.py
copyright: Dan Haim <negativeiq@users.sourceforge.net>
license: BSD
Images Authors:
* files: src/Icons/*.png
copyright: Gnome Icon Theme
......
* Mon Jan 11 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.7
- BUGFIX: Fix 'Add in pause' setting in torrent addition dialog
- BUGFIX: Update RSS feed as soon as feed downloader is enabled
- BUGFIX: RSS Feed downloader ignores articles above maximum number of articles
- BUGFIX: Fix possible bug when deleting a RSS folder
- BUGFIX: Remove persistant data when a RSS feed is deleted
- BUGFIX: RSS filters are now alphabetically sorted
- BUGFIX: Fix crash when renaming currently displayed RSS filter
- BUGFIX: Remove overwriting confirmation when exporting RSS filters since Qt takes care of it
* Tue Jan 5 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.6
- BUGFIX: Fix detection of invalid torrent files
- BUGFIX: Stop catching signals once one has been caught to avoid possible infinite loop
- BUGFIX: Force data recheck whenever a torrent is moved
- BUGFIX: Detect existing torrent data even if incomplete torrents are saved to a different folder
- COSMETIC: Improve torrent deletion confirmation dialog so that the text that not get truncated
* Thu Dec 31 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.5
- BUGFIX: Fix crash with downloaded/availability bars when the torrent has too many pieces
* Wed Dec 30 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.4
- BUGFIX: Fix PeerGuardian .p2b binary filter support
- BUGFIX: Fix possible crash when closing a search engine tab
- BUGFIX: Make sure service port does not change
- BUGFIX: Fix possible DHT port saving issue
- BUGFIX: Fix communication between qBittorrent and Web UI (Qt 4.6)
- BUGFIX: Use Wildcard matching instead of full regex in RSS feed downloader
- BUGFIX: Fix code for listening on a random port whenever it failed to listen on the one defined
- BUGFIX: Use global maximum transfer rates as maximum values in per-torrent speed limiting dialogs
- BUGFIX: Fix global download rate limiting from Web UI
- COSMETIC: Display a disconnected icon in status bar whenever qBittorrent failed to listen on the port defined
* Wed Dec 23 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.3
- BUGFIX: Minor cosmetic fix to program preferences
- BUGFIX: Fix "Temp path" button in program preferences
- BUGFIX: Handle paths with [~, ., ..] properly
- BUGFIX: Trackers are now displayed for torrents without metadata
- BUGFIX: Fix issue with speed limiting (unlimited was not handled properly)
- BUGFIX: Use the save path set in program preferences as a default in torrent addition dialog
* Fri Dec 18 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.2
- BUGFIX: Fix .qbittorrent folder not being created (critical bug introduced in v2.0.1 that makes qBittorrent unusuable for new users)
- BUGFIX: Fix RSS Feed downloader for some feeds
- BUGFIX: Do not use home folder as a fallback when the save path is not accessible
- BUGFIX: Fix Mininova, ThePirateBay search engine plugins
- BUGFIX: Read RSS articles are remembered on restart for feeds with no torrents attached
* Sun Dec 13 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.1
- BUGFIX: µTorrent user-agent is now spoofed correctly
- BUGFIX: Fix column hiding behavior when queueing system is disabled
- BUGFIX: Fix link to plugins.qbittorrent.org in plugins dialog
- BUGFIX: ~/qBT_dir is created only when it is actually used
- BUGFIX: Fix possible missing slot message (toggleSelectedTorrentsSuperSeeding)
- BUGFIX: Fix possible crash in torrent properties (files)
- BUGFIX: Added Hex Magnet Links support (Thanks Haypo)
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.1.0
- FEATURE: Graphical User Interface can be disabled at compilation time (headless running)
- FEATURE: Torrents can be labeled/categorized
- FEATURE: Labeled torrent can be downloaded corresponding subfolders
- FEATURE: Disk cache size can be set from preferences
- FEATURE: Peer Exchange (PeX) can be disabled from preferences
- FEATURE: Append !.qB extension to incomplete files option (libtorrent >= v0.15 only)
- FEATURE: Torrent files/folders can be renamed (torrent addition dialog or files properties)
- FEATURE: uTorrent compatible tracker list support (use torrentz.com url as a default)
- FEATURE: Better proxy support and preferences remodeling
- FEATURE: qBittorrent can identify itself as uTorrent, Vuze or KTorrent (Any stable version)
- FEATURE: Torrents can be renamed in transfer list
- FEATURE: Display torrent addition dialog for magnet links too
- FEATURE: Files contained in a torrent are opened on double click (files panel)
- FEATURE: Added support for magnet links in search engine
- FEATURE: Added vertor.com and torrentdownloads.net search plugins
- FEATURE: Search engine can now use a SOCKS5 proxy
- BUGFIX: Search engine loads new proxy settings without program restart
- BUGFIX: Use XDG folders (.cache, .local) instead of .qbittorrent
- BUGFIX: Added legal notice on startup that the user must accept
- BUGFIX: Protect Web UI authentication against brute forcing
- COSMETIC: Use checkboxes to filter torrent content instead of comboboxes
- COSMETIC: Use alternating row colors in transfer list (set in program preferences)
- COSMETIC: Added a spin box to speed limiting dialog for manual input
* Thu Dec 10 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.0
- FEATURE: Added program option to disable splash screen
......
qBittorrent - A BitTorrent client in C++ / Qt4
------------------------------------------
./configure
make && make install
qbittorrent
1) Compile and install qBittorrent with Qt4 Graphical Interface
will install and execute qBittorrent hopefully without any problems.
$ ./configure
$ make && make install
$ qbittorrent
Dependencies:
- Qt >= 4.4.0 (libqt-devel, libqtgui, libqtcore, libqtnetwork, libqtxml)
will install and execute qBittorrent hopefully without any problems.
- libtorrent-rasterbar by Arvid Norberg (>= 0.14.0 REQUIRED, >= v0.15.0 ADVISED)
-> http://www.qbittorrent.org/download.php (advised)
Dependencies:
- Qt >= 4.4.0 (libqt-devel, libqtgui, libqtcore, libqtnetwork, libqtxml)
- libtorrent-rasterbar by Arvid Norberg (>= 0.14.4 REQUIRED, >= v0.15.0 ADVISED)
-> http://www.libtorrent.net
Be careful: another library (the one used by rTorrent) uses a similar name.
- libboost: libboost-filesystem, libboost-date-time, libboost-thread, libboost-serialization
- libboost: libboost-filesystem, libboost-date-time, libboost-thread, libboost-serialization
- python >= 2.3 (needed by search engine)
- python >= 2.3 (needed by search engine)
* Run time only dependency
- libnotify >= 0.4.2, glib-2.0 (optional)
- libnotify >= 0.4.2, glib-2.0 (optional)
* Can be used for system notifications to replace standard Qt notifications
so that it integrates better into the Desktop
- geoip-database (optional)
- geoip-database (optional)
* If qBittorrent cannot find this database, it will try to resolve countries using the Internet but it will be a lot slower.
* Run time only dependency
2) Compile and install qBittorrent without Qt4 Graphical interface
$ ./configure --disable-gui
$ make && make install
$ qbittorrent
will install and execute qBittorrent hopefully without any problems.
Dependencies:
- Qt >= 4.4.0 (libqt-devel, libqtcore, libqtnetwork, libqtxml)
- libtorrent-rasterbar by Arvid Norberg (>= 0.14.0 REQUIRED, >= v0.15.0 ADVISED)
-> http://www.libtorrent.net
Be careful: another library (the one used by rTorrent) uses a similar name.
- libboost: libboost-filesystem, libboost-date-time, libboost-thread, libboost-serialization
DOCUMENTATION:
Please note that there is a documentation with a "compiling howto" at http://wiki.qbittorrent.org.
......
......@@ -18,6 +18,8 @@ Main options:
--help This help text.
Dependency options:
--disable-gui Disable qBittorrent Graphical user
interface for headless running
--with-libboost-inc=[path] Path to libboost include files
--disable-libnotify Disable use of libnotify
--disable-geoip-database Disable use of geoip-database
......@@ -140,6 +142,11 @@ while [ $# -gt 0 ]; do
shift
;;
--disable-gui)
QC_DISABLE_GUI="Y"
shift
;;
--with-libboost-inc=*)
QC_WITH_LIBBOOST_INC=$optarg
shift
......@@ -181,6 +188,7 @@ echo PREFIX=$PREFIX
echo BINDIR=$BINDIR
echo DATADIR=$DATADIR
echo EX_QTDIR=$EX_QTDIR
echo QC_DISABLE_GUI=$QC_DISABLE_GUI
echo QC_WITH_LIBBOOST_INC=$QC_WITH_LIBBOOST_INC
echo QC_DISABLE_libnotify=$QC_DISABLE_libnotify
echo QC_DISABLE_geoip_database=$QC_DISABLE_geoip_database
......@@ -290,6 +298,7 @@ cat >$1/modules.cpp <<EOT
/*
-----BEGIN QCMOD-----
name: Qt >= 4.4
arg: disable-gui, Disable qBittorrent Graphical user interface for headless running
-----END QCMOD-----
*/
class qc_qt4 : public ConfObj
......@@ -300,6 +309,9 @@ public:
QString shortname() const { return "Qt 4.4"; }
bool exec()
{
if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) {
conf->addDefine("DISABLE_GUI");
}
if(QT_VERSION >= 0x040500) {
conf->addDefine("QT_4_5");
}
......@@ -410,6 +422,10 @@ public:
QString name() const { return "libnotify >= 0.4.2 (optional)"; }
QString shortname() const { return "libnotify"; }
bool exec(){
if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) {
printf("\nNot Required");
return true;
}
QStringList incs;
QString req_ver = "0.4.2";
QString version, libs, other;
......@@ -453,6 +469,10 @@ public:
QString name() const { return "GeoIP Database (optional)"; }
QString shortname() const { return "GeoIP Database"; }
bool exec() {
if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) {
printf("\nNot Required");
return true;
}
#ifdef Q_WS_X11
if(!conf->getenv("QC_WITH_GEOIP_DATABASE_EMBEDDED").isEmpty()) {
#endif
......@@ -1431,6 +1451,7 @@ export PREFIX
export BINDIR
export DATADIR
export EX_QTDIR
export QC_DISABLE_GUI
export QC_WITH_LIBBOOST_INC
export QC_DISABLE_libnotify
export QC_DISABLE_geoip_database
......
.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>.
.TH "QBITTORRENT\-NOX" "1" "January 4th 2009" "Command line Bittorrent client written in C++ / Qt4" ""
.SH "NAME"
qBittorrent\-nox \- a command line Bittorrent client written in C++ / Qt4
.SH "SYNOPSIS"
\fBqbittorrent\-nox\fR [\-\-webui-port=x] [TORRENT_FILE | URL]...
\fBqbittorrent\-nox\fR \-\-help
\fBqbittorrent\-nox\fR \-\-version
.PP
.SH "DESCRIPTION"
\fBqBittorrent-nox\fR is an advanced command-line Bittorrent client written in C++ / Qt4,
using the \fBlibtorrent-rasterbar\fR library by Arvid Norberg. qBittorrent\-nox aims
to be a good alternative to other command line bittorrent clients and provides features similar to popular graphical clients.
qBittorrent\-nox is fast, stable, light and it supports unicode.
It also comes with UPnP port forwarding / NAT-PMP, encryption (Vuze compatible),
FAST extension (mainline) and PeX support (utorrent compatible).
qBittorrent\-nox is meant to be controlled via its feature-rich Web UI which is accessible as a default on http://localhost:8080. The Web UI access is secured and the default account user name is "admin" with "adminadmin" as a password.
.SH "OPTIONS"
\fB--help\fR Prints the command line options.
\fB--version\fR Prints qbittorrent program version number.
\fB--webui-port=x\fR Changes Web UI port to x (default: 8080).
.SH "BUGS"
If you find a bug, please report it at http://bugs.qbittorrent.org
.SH "AUTHOR"
Christophe Dumez <chris@qbittorrent.org>
.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>.
.TH "QBITTORRENT" "1" "September 30th 2009" "Bittorrent client written in C++ / Qt4" ""
.TH "QBITTORRENT" "1" "January 4th 2009" "Bittorrent client written in C++ / Qt4" ""
.SH "NAME"
qBittorrent \- a Bittorrent client written in C++ / Qt4
.SH "SYNOPSIS"
\fBqbittorrent\fR [\-\-no-splash] [TORRENT_FILE | URL]...
\fBqbittorrent\fR [\-\-no-splash] [\-\-webui-port=x] [TORRENT_FILE | URL]...
\fBqbittorrent\fR \-\-help
......@@ -18,10 +18,9 @@ qBittorrent \- a Bittorrent client written in C++ / Qt4
.SH "DESCRIPTION"
\fBqBittorrent\fR is an advanced Bittorrent client written in C++ / Qt4,
using the \fBrblibtorrent\fR library by Arvid Norberg. qBittorrent aims
to be a good alternative to all other bittorrent clients out there. qBittorrent
using the \fBlibtorrent-rasterbar\fR library by Arvid Norberg. qBittorrent is similar to uTorrent. qBittorrent
is fast, stable, light, it supports unicode and it provides a good integrated search engine.
It also comes with UPnP port forwarding / NAT-PMP, encryption (Azureus compatible),
It also comes with UPnP port forwarding / NAT-PMP, encryption (Vuze compatible),
FAST extension (mainline) and PeX support (utorrent compatible).
.SH "OPTIONS"
......@@ -32,6 +31,8 @@ FAST extension (mainline) and PeX support (utorrent compatible).
\fB--no-splash\fR Disables splash screen on startup.
\fB--webui-port=x\fR Changes Web UI port to x (default: 8080).
.SH "BUGS"
If you find a bug, please report it at http://bugs.qbittorrent.org
......
......@@ -12,6 +12,10 @@ public:
QString name() const { return "GeoIP Database (optional)"; }
QString shortname() const { return "GeoIP Database"; }
bool exec() {
if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) {
printf("\nNot Required");
return true;
}
#ifdef Q_WS_X11
if(!conf->getenv("QC_WITH_GEOIP_DATABASE_EMBEDDED").isEmpty()) {
#endif
......
......@@ -11,6 +11,10 @@ public:
QString name() const { return "libnotify >= 0.4.2 (optional)"; }
QString shortname() const { return "libnotify"; }
bool exec(){
if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) {
printf("\nNot Required");
return true;
}
QStringList incs;
QString req_ver = "0.4.2";
QString version, libs, other;
......
/*
-----BEGIN QCMOD-----
name: Qt >= 4.4
arg: disable-gui, Disable qBittorrent Graphical user interface for headless running
-----END QCMOD-----
*/
class qc_qt4 : public ConfObj
......@@ -11,6 +12,9 @@ public:
QString shortname() const { return "Qt 4.4"; }
bool exec()
{
if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) {
conf->addDefine("DISABLE_GUI");
}
if(QT_VERSION >= 0x040500) {
conf->addDefine("QT_4_5");
}
......
......@@ -60,6 +60,8 @@
#include "speedlimitdlg.h"
#include "preferences.h"
#include "console_imp.h"
#include "trackerlist.h"
#include "peerlistwidget.h"
#include "torrentpersistentdata.h"
#include "transferlistfilterswidget.h"
#include "propertieswidget.h"
......@@ -78,6 +80,7 @@ using namespace libtorrent;
// Constructor
GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), displaySpeedInTitle(false), force_exit(false) {
setupUi(this);
setWindowTitle(tr("qBittorrent %1", "e.g: qBittorrent v0.x").arg(QString::fromUtf8(VERSION)));
// Setting icons
this->setWindowIcon(QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent32.png")));
......@@ -650,8 +653,12 @@ void GUI::processParams(const QStringList& params) {
BTSession->downloadFromUrl(param);
}else{
if(param.startsWith("magnet:", Qt::CaseInsensitive)) {
// FIXME: Possibily skipped torrent addition dialog
if(useTorrentAdditionDialog) {
torrentAdditionDialog *dialog = new torrentAdditionDialog(this, BTSession);
dialog->showLoadMagnetURI(param);
} else {
BTSession->addMagnetUri(param);
}
} else {
if(useTorrentAdditionDialog) {
torrentAdditionDialog *dialog = new torrentAdditionDialog(this, BTSession);
......@@ -724,7 +731,10 @@ void GUI::loadPreferences(bool configure_session) {
}
unsigned int new_refreshInterval = Preferences::getRefreshInterval();
transferList->setRefreshInterval(new_refreshInterval);
transferList->setAlternatingRowColors(Preferences::useAlternatingRowColors());
properties->getFilesList()->setAlternatingRowColors(Preferences::useAlternatingRowColors());
properties->getTrackerList()->setAlternatingRowColors(Preferences::useAlternatingRowColors());
properties->getPeerList()->setAlternatingRowColors(Preferences::useAlternatingRowColors());
// Queueing System
if(Preferences::isQueueingSystemEnabled()) {
if(!configure_session || !BTSession->isQueueingEnabled()) {
......@@ -832,9 +842,16 @@ void GUI::showNotificationBaloon(QString title, QString msg) const {
*****************************************************/
void GUI::downloadFromURLList(const QStringList& url_list) {
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
bool useTorrentAdditionDialog = settings.value(QString::fromUtf8("Preferences/Downloads/AdditionDialog"), true).toBool();
foreach(const QString url, url_list) {
if(url.startsWith("magnet:", Qt::CaseInsensitive)) {
if(useTorrentAdditionDialog) {
torrentAdditionDialog *dialog = new torrentAdditionDialog(this, BTSession);
dialog->showLoadMagnetURI(url);
} else {
BTSession->addMagnetUri(url);
}
} else {
BTSession->downloadFromUrl(url);
}
......
......@@ -59,7 +59,7 @@ class StatusBar;
class GUI : public QMainWindow, private Ui::MainWindow{
Q_OBJECT
private:
private:
// Bittorrent
Bittorrent *BTSession;
QList<QPair<QTorrentHandle,QString> > unauthenticated_trackers; // Still needed?
......@@ -93,7 +93,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
// Misc
QLocalServer *localServer;
protected slots:
protected slots:
// GUI related slots
void dropEvent(QDropEvent *event);
void dragEnterEvent(QDragEnterEvent *event);
......@@ -130,7 +130,6 @@ class GUI : public QMainWindow, private Ui::MainWindow{
void addTorrent(QString path);
void addUnauthenticatedTracker(QPair<QTorrentHandle,QString> tracker);
void processDownloadedFiles(QString path, QString url);
void downloadFromURLList(const QStringList& urls);
void finishedTorrent(QTorrentHandle& h) const;
// Options slots
void on_actionOptions_triggered();
......@@ -139,18 +138,19 @@ class GUI : public QMainWindow, private Ui::MainWindow{
void on_actionDownload_from_URL_triggered();
public slots:
public slots:
void trackerAuthenticationRequired(QTorrentHandle& h);
void setTabText(int index, QString text) const;
void showNotificationBaloon(QString title, QString msg) const;
void downloadFromURLList(const QStringList& urls);
protected:
protected:
void closeEvent(QCloseEvent *);
void showEvent(QShowEvent *);
bool event(QEvent * event);
void displayRSSTab(bool enable);
public:
public:
// Construct / Destruct
GUI(QWidget *parent=0, QStringList torrentCmdLine=QStringList());
~GUI();
......
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
[Desktop Entry]
Categories=Qt;Network;P2P;
Comment=V2.0.7
Comment=V2.1.0
Exec=qbittorrent %f
GenericName=Bittorrent client
GenericName[bg]=Торент клиент
......
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
......@@ -34,8 +34,12 @@
#include <QMap>
#include <QUrl>
#include <QStringList>
#ifdef DISABLE_GUI
#include <QCoreApplication>
#else
#include <QApplication>
#include <QPalette>
#endif
#include <QPointer>
#include <libtorrent/session.hpp>
......@@ -108,12 +112,19 @@ private:
bool LSDEnabled;
bool DHTEnabled;
int current_dht_port;
bool PeXEnabled;
bool queueingEnabled;
bool appendLabelToSavePath;
#ifdef LIBTORRENT_0_15
bool appendqBExtension;
#endif
QString defaultSavePath;
QString defaultTempPath;
// GeoIP
#ifndef DISABLE_GUI
bool resolve_countries;
bool geoipDBLoaded;
#endif
// ETA Computation
QPointer<QTimer> timerETA;
QHash<QString, QList<int> > ETA_samples;
......@@ -195,10 +206,18 @@ public slots:
void setGlobalRatio(float ratio);
void setDeleteRatio(float ratio);
void setDHTPort(int dht_port);
void setProxySettings(proxy_settings proxySettings, bool trackers=true, bool peers=true, bool web_seeds=true, bool dht=true);
void setPeerProxySettings(proxy_settings proxySettings);
void setHTTPProxySettings(proxy_settings proxySettings);
void setSessionSettings(session_settings sessionSettings);
void startTorrentsInPause(bool b);
void setDefaultTempPath(QString temppath);
void setAppendLabelToSavePath(bool append);
void appendLabelToTorrentSavePath(QTorrentHandle h);
void changeLabelInTorrentSavePath(QTorrentHandle h, QString old_label, QString new_label);
#ifdef LIBTORRENT_0_15
void appendqBextensionToTorrent(QTorrentHandle h, bool append);
void setAppendqBExtension(bool append);
#endif
void applyEncryptionSettings(pe_settings se);
void setDownloadLimit(QString hash, long val);
void setUploadLimit(QString hash, long val);
......@@ -206,7 +225,11 @@ public slots:
void enableNATPMP(bool b);
void enableLSD(bool b);
bool enableDHT(bool b);
#ifdef DISABLE_GUI
void addConsoleMessage(QString msg, QString color=QString::null);
#else
void addConsoleMessage(QString msg, QColor color=QApplication::palette().color(QPalette::WindowText));
#endif
void addPeerBanMessage(QString msg, bool from_ipfilter);
void processDownloadedFile(QString, QString);
void addMagnetSkipAddDlg(QString uri);
......@@ -234,6 +257,8 @@ signals:
void downloadFromUrlFailure(QString url, QString reason);
void torrentFinishedChecking(QTorrentHandle& h);
void metadataReceived(QTorrentHandle &h);
void savePathChanged(QTorrentHandle &h);
void newConsoleMessage(QString msg);
};
#endif
......@@ -35,6 +35,8 @@
#include <QNetworkRequest>
#include <QNetworkProxy>
enum ProxyType {HTTP=1, SOCKS5=2, HTTP_PW=3, SOCKS5_PW=4, SOCKS4=5};
/** Download Thread **/
downloadThread::downloadThread(QObject* parent) : QObject(parent) {
......@@ -105,7 +107,7 @@ void downloadThread::applyProxySettings() {
qDebug("Using proxy: %s", (IP+QString(":")+port).toLocal8Bit().data());
proxy.setPort(port.toUShort());
// Default proxy type is HTTP, we must change if it is SOCKS5
if(intValue%2==0) {
if(intValue == SOCKS5 || intValue == SOCKS5_PW) {
qDebug("Proxy is SOCKS5, not HTTP");
proxy.setType(QNetworkProxy::Socks5Proxy);
} else {
......
......@@ -170,7 +170,7 @@ void engineSelectDlg::on_actionUninstall_triggered() {
}else {
// Proceed with uninstall
// remove it from hard drive
QDir enginesFolder(misc::qBittorrentPath()+"search_engine"+QDir::separator()+"engines");
QDir enginesFolder(misc::searchEngineLocation()+QDir::separator()+"engines");
QStringList filters;
filters << id+".*";
QStringList files = enginesFolder.entryList(filters, QDir::Files, QDir::Unsorted);
......@@ -245,7 +245,7 @@ QTreeWidgetItem* engineSelectDlg::findItemWithID(QString id){
}
bool engineSelectDlg::isUpdateNeeded(QString plugin_name, float new_version) const {
float old_version = SearchEngine::getPluginVersion(misc::qBittorrentPath()+"search_engine"+QDir::separator()+"engines"+QDir::separator()+plugin_name+".py");
float old_version = SearchEngine::getPluginVersion(misc::searchEngineLocation()+QDir::separator()+"engines"+QDir::separator()+plugin_name+".py");
qDebug("IsUpdate needed? tobeinstalled: %.2f, alreadyinstalled: %.2f", new_version, old_version);
return (new_version > old_version);
}
......@@ -260,7 +260,7 @@ void engineSelectDlg::installPlugin(QString path, QString plugin_name) {
return;
}
// Process with install
QString dest_path = misc::qBittorrentPath()+"search_engine"+QDir::separator()+"engines"+QDir::separator()+plugin_name+".py";
QString dest_path = misc::searchEngineLocation()+QDir::separator()+"engines"+QDir::separator()+plugin_name+".py";
bool update = false;
if(QFile::exists(dest_path)) {
// Backup in case install fails
......@@ -324,12 +324,12 @@ void engineSelectDlg::addNewEngine(QString engine_name) {
setRowColor(pluginsTree->indexOfTopLevelItem(item), "red");
}
// Handle icon
QString iconPath = misc::qBittorrentPath()+"search_engine"+QDir::separator()+"engines"+QDir::separator()+engine->getName()+".png";
QString iconPath = misc::searchEngineLocation()+QDir::separator()+"engines"+QDir::separator()+engine->getName()+".png";
if(QFile::exists(iconPath)) {
// Good, we already have the icon
item->setData(ENGINE_NAME, Qt::DecorationRole, QVariant(QIcon(iconPath)));
} else {
iconPath = misc::qBittorrentPath()+"search_engine"+QDir::separator()+"engines"+QDir::separator()+engine->getName()+".ico";
iconPath = misc::searchEngineLocation()+QDir::separator()+"engines"+QDir::separator()+engine->getName()+".ico";
if(QFile::exists(iconPath)) { // ICO support
item->setData(ENGINE_NAME, Qt::DecorationRole, QVariant(QIcon(iconPath)));
} else {
......@@ -427,9 +427,9 @@ void engineSelectDlg::processDownloadedFile(QString url, QString filePath) {
QFile icon(filePath);
icon.open(QIODevice::ReadOnly);
if(ICOHandler::canRead(&icon))
iconPath = misc::qBittorrentPath()+"search_engine"+QDir::separator()+"engines"+QDir::separator()+id+".ico";
iconPath = misc::searchEngineLocation()+QDir::separator()+"engines"+QDir::separator()+id+".ico";
else
iconPath = misc::qBittorrentPath()+"search_engine"+QDir::separator()+"engines"+QDir::separator()+id+".png";
iconPath = misc::searchEngineLocation()+QDir::separator()+"engines"+QDir::separator()+id+".png";
QFile::copy(filePath, iconPath);
item->setData(ENGINE_NAME, Qt::DecorationRole, QVariant(QIcon(iconPath)));
}
......
......@@ -33,7 +33,7 @@
#include "bittorrent.h"
#include "misc.h"
#include "preferences.h"
#include "proplistdelegate.h"
//#include "proplistdelegate.h"
#include "torrentpersistentdata.h"
#include <QDebug>
......@@ -122,14 +122,162 @@ QList<QVariantMap> EventManager::getPropFilesInfo(QString hash) const {
return files;
}
void EventManager::setGlobalPreferences(QVariantMap m) const {
// UI
if(m.contains("locale"))
Preferences::setLocale(m["locale"].toString());
// Downloads
if(m.contains("save_path"))
Preferences::setSavePath(m["save_path"].toString());
if(m.contains("temp_path_enabled"))
Preferences::setTempPathEnabled(m["temp_path_enabled"].toBool());
if(m.contains("temp_path"))
Preferences::setTempPath(m["temp_path"].toString());
if(m.contains("scan_dir"))
Preferences::setScanDir(m["scan_dir"].toString());
if(m.contains("preallocate_all"))
Preferences::preAllocateAllFiles(m["preallocate_all"].toBool());
if(m.contains("queueing_enabled"))
Preferences::setQueueingSystemEnabled(m["queueing_enabled"].toBool());
if(m.contains("max_active_downloads"))
Preferences::setMaxActiveDownloads(m["max_active_downloads"].toInt());
if(m.contains("max_active_torrents"))
Preferences::setMaxActiveTorrents(m["max_active_torrents"].toInt());
if(m.contains("max_active_uploads"))
Preferences::setMaxActiveUploads(m["max_active_uploads"].toInt());
#ifdef LIBTORRENT_0_15
if(m.contains("incomplete_files_ext"))
Preferences::useIncompleteFilesExtension(m["incomplete_files_ext"].toBool());
#endif
// Connection
if(m.contains("listen_port"))
Preferences::setSessionPort(m["listen_port"].toInt());
if(m.contains("upnp"))
Preferences::setUPnPEnabled(m["upnp"].toBool());
if(m.contains("natpmp"))
Preferences::setNATPMPEnabled(m["natpmp"].toBool());
if(m.contains("dl_limit"))
Preferences::setGlobalDownloadLimit(m["dl_limit"].toInt());
if(m.contains("up_limit"))
Preferences::setGlobalUploadLimit(m["up_limit"].toInt());
if(m.contains("max_connec"))
Preferences::setMaxConnecs(m["max_connec"].toInt());
if(m.contains("max_connec_per_torrent"))
Preferences::setMaxConnecsPerTorrent(m["max_connec_per_torrent"].toInt());
if(m.contains("max_uploads_per_torrent"))
Preferences::setMaxUploadsPerTorrent(m["max_uploads_per_torrent"].toInt());
// Bittorrent
if(m.contains("dht"))
Preferences::setDHTEnabled(m["dht"].toBool());
if(m.contains("pex"))
Preferences::setPeXEnabled(m["pex"].toBool());
qDebug("Pex support: %d", (int)m["pex"].toBool());
if(m.contains("lsd"))
Preferences::setLSDEnabled(m["lsd"].toBool());
if(m.contains("encryption"))
Preferences::setEncryptionSetting(m["encryption"].toInt());
if(m.contains("peer_id"))
Preferences::setPeerID(m["peer_id"].toString());
if(m.contains("peer_version"))
Preferences::setClientVersion(m["peer_version"].toString());
if(m.contains("peer_build"))
Preferences::setClientBuild(m["peer_build"].toString());
// Proxy
if(m.contains("proxy_type"))
Preferences::setPeerProxyType(m["proxy_type"].toInt());
if(m.contains("proxy_ip"))
Preferences::setPeerProxyIp(m["proxy_ip"].toString());
if(m.contains("proxy_port"))