2007-03-05 16:55:23 +03:00
|
|
|
/*
|
|
|
|
* Bittorrent Client using Qt4 and libtorrent.
|
2007-07-14 18:31:59 +04:00
|
|
|
* Copyright (C) 2006 Christophe Dumez
|
2007-03-05 16:55:23 +03:00
|
|
|
*
|
2007-07-14 18:31:59 +04:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2007-03-05 16:55:23 +03:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2007-07-14 18:31:59 +04:00
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
2009-04-05 21:00:55 +04:00
|
|
|
* In addition, as a special exception, the copyright holders give permission to
|
|
|
|
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
|
|
|
* modified versions of it that use the same license as the "OpenSSL" library),
|
|
|
|
* and distribute the linked executables. You must obey the GNU General Public
|
|
|
|
* License in all respects for all of the code used other than "OpenSSL". If you
|
|
|
|
* modify file(s), you may extend this exception to your version of the file(s),
|
|
|
|
* but you are not obligated to do so. If you do not wish to do so, delete this
|
|
|
|
* exception statement from your version.
|
|
|
|
*
|
2007-07-14 18:31:59 +04:00
|
|
|
* Contact : chris@qbittorrent.org
|
2007-03-05 16:55:23 +03:00
|
|
|
*/
|
|
|
|
#ifndef __BITTORRENT_H__
|
|
|
|
#define __BITTORRENT_H__
|
|
|
|
|
2014-05-01 23:53:29 +04:00
|
|
|
#include <QMap>
|
2007-06-29 19:23:15 +04:00
|
|
|
#include <QHash>
|
2009-12-06 17:41:05 +03:00
|
|
|
#include <QUrl>
|
2007-07-23 16:46:36 +04:00
|
|
|
#include <QStringList>
|
2010-01-03 01:20:37 +03:00
|
|
|
#ifdef DISABLE_GUI
|
2010-01-03 02:03:46 +03:00
|
|
|
#include <QCoreApplication>
|
2010-01-03 01:20:37 +03:00
|
|
|
#else
|
2010-01-03 02:03:46 +03:00
|
|
|
#include <QApplication>
|
|
|
|
#include <QPalette>
|
2010-01-03 01:20:37 +03:00
|
|
|
#endif
|
2008-09-13 11:33:41 +04:00
|
|
|
#include <QPointer>
|
2010-03-21 00:21:42 +03:00
|
|
|
#include <QTimer>
|
2012-05-20 17:03:10 +04:00
|
|
|
#include <QNetworkCookie>
|
2007-06-29 19:23:15 +04:00
|
|
|
|
2010-06-07 12:32:41 +04:00
|
|
|
#include <libtorrent/version.hpp>
|
2007-03-05 16:55:23 +03:00
|
|
|
#include <libtorrent/session.hpp>
|
2007-10-01 13:47:00 +04:00
|
|
|
#include <libtorrent/ip_filter.hpp>
|
2014-05-25 00:30:30 +04:00
|
|
|
#include <libtorrent/alert_types.hpp>
|
2010-10-09 18:32:00 +04:00
|
|
|
|
2010-10-16 01:55:56 +04:00
|
|
|
#include "qtracker.h"
|
2007-08-20 10:29:18 +04:00
|
|
|
#include "qtorrenthandle.h"
|
2010-10-09 18:32:00 +04:00
|
|
|
#include "trackerinfos.h"
|
2014-05-17 13:04:33 +04:00
|
|
|
#include "alertdispatcher.h"
|
2014-07-06 13:13:36 +04:00
|
|
|
#include "misc.h"
|
2007-03-05 16:55:23 +03:00
|
|
|
|
2009-11-16 23:28:58 +03:00
|
|
|
#define MAX_SAMPLES 20
|
|
|
|
|
2011-01-24 20:58:57 +03:00
|
|
|
class DownloadThread;
|
2008-05-18 00:32:03 +04:00
|
|
|
class FilterParserThread;
|
2009-11-18 20:46:59 +03:00
|
|
|
class HttpServer;
|
2010-01-24 14:57:15 +03:00
|
|
|
class BandwidthScheduler;
|
2010-02-28 18:15:00 +03:00
|
|
|
class ScanFoldersModel;
|
2010-12-18 18:34:38 +03:00
|
|
|
class TorrentSpeedMonitor;
|
2014-05-24 16:24:33 +04:00
|
|
|
class TorrentStatistics;
|
2011-04-15 17:02:39 +04:00
|
|
|
class DNSUpdater;
|
2007-03-08 01:36:01 +03:00
|
|
|
|
2013-09-20 00:41:04 +04:00
|
|
|
const int MAX_LOG_MESSAGES = 1000;
|
2011-06-20 23:28:55 +04:00
|
|
|
|
2012-08-21 11:16:49 +04:00
|
|
|
enum TorrentExportFolder {
|
|
|
|
RegularTorrentExportFolder,
|
|
|
|
FinishedTorrentExportFolder
|
|
|
|
};
|
|
|
|
|
2010-10-17 18:46:01 +04:00
|
|
|
class QBtSession : public QObject {
|
2007-03-05 20:35:38 +03:00
|
|
|
Q_OBJECT
|
2010-10-31 15:35:07 +03:00
|
|
|
Q_DISABLE_COPY(QBtSession)
|
2010-10-31 02:40:28 +04:00
|
|
|
|
2011-02-24 20:36:20 +03:00
|
|
|
public:
|
2011-02-26 18:04:15 +03:00
|
|
|
static const qreal MAX_RATIO;
|
2011-02-24 20:36:20 +03:00
|
|
|
|
2010-11-13 22:36:46 +03:00
|
|
|
private:
|
|
|
|
explicit QBtSession();
|
|
|
|
static QBtSession* m_instance;
|
|
|
|
|
2009-11-19 11:14:04 +03:00
|
|
|
public:
|
2010-11-13 22:36:46 +03:00
|
|
|
static QBtSession* instance();
|
|
|
|
static void drop();
|
2010-10-17 18:46:01 +04:00
|
|
|
~QBtSession();
|
2011-02-26 22:56:15 +03:00
|
|
|
QTorrentHandle getTorrentHandle(const QString &hash) const;
|
2010-11-23 00:55:32 +03:00
|
|
|
std::vector<libtorrent::torrent_handle> getTorrents() const;
|
2011-02-26 22:56:15 +03:00
|
|
|
bool isFilePreviewPossible(const QString& hash) const;
|
2011-01-25 20:04:55 +03:00
|
|
|
qreal getPayloadDownloadRate() const;
|
|
|
|
qreal getPayloadUploadRate() const;
|
2010-11-23 00:55:32 +03:00
|
|
|
libtorrent::session_status getSessionStatus() const;
|
2009-11-19 11:14:04 +03:00
|
|
|
int getListenPort() const;
|
2014-05-14 02:09:45 +04:00
|
|
|
qreal getRealRatio(const libtorrent::torrent_status &status) const;
|
2011-02-26 22:56:15 +03:00
|
|
|
QHash<QString, TrackerInfos> getTrackersInfo(const QString &hash) const;
|
2009-11-19 11:14:04 +03:00
|
|
|
bool hasActiveTorrents() const;
|
2010-08-16 21:35:32 +04:00
|
|
|
bool hasDownloadingTorrents() const;
|
2010-10-31 02:40:28 +04:00
|
|
|
//int getMaximumActiveDownloads() const;
|
|
|
|
//int getMaximumActiveTorrents() const;
|
|
|
|
inline QStringList getConsoleMessages() const { return consoleMessages; }
|
|
|
|
inline QStringList getPeerBanMessages() const { return peerBanMessages; }
|
2010-11-23 00:55:32 +03:00
|
|
|
inline libtorrent::session* getSession() const { return s; }
|
2010-10-31 02:40:28 +04:00
|
|
|
inline bool useTemporaryFolder() const { return !defaultTempPath.isEmpty(); }
|
|
|
|
inline QString getDefaultSavePath() const { return defaultSavePath; }
|
|
|
|
inline ScanFoldersModel* getScanFoldersModel() const { return m_scanFolders; }
|
|
|
|
inline bool isDHTEnabled() const { return DHTEnabled; }
|
|
|
|
inline bool isLSDEnabled() const { return LSDEnabled; }
|
2011-01-11 00:09:47 +03:00
|
|
|
inline bool isPexEnabled() const { return PeXEnabled; }
|
2010-10-31 02:40:28 +04:00
|
|
|
inline bool isQueueingEnabled() const { return queueingEnabled; }
|
2013-11-14 23:56:13 +04:00
|
|
|
quint64 getAlltimeDL() const;
|
|
|
|
quint64 getAlltimeUL() const;
|
2014-05-18 12:07:49 +04:00
|
|
|
void postTorrentUpdate();
|
2007-03-05 16:55:23 +03:00
|
|
|
|
2009-11-19 11:14:04 +03:00
|
|
|
public slots:
|
|
|
|
QTorrentHandle addTorrent(QString path, bool fromScanDir = false, QString from_url = QString(), bool resumed = false);
|
2012-05-28 16:21:09 +04:00
|
|
|
QTorrentHandle addMagnetUri(QString magnet_uri, bool resumed=false, bool fromScanDir=false, const QString &filePath=QString());
|
2009-11-19 11:14:04 +03:00
|
|
|
void loadSessionState();
|
|
|
|
void saveSessionState();
|
2012-05-20 17:03:10 +04:00
|
|
|
void downloadFromUrl(const QString &url, const QList<QNetworkCookie>& cookies = QList<QNetworkCookie>());
|
2011-02-26 22:56:15 +03:00
|
|
|
void deleteTorrent(const QString &hash, bool delete_local_files = false);
|
2009-11-19 11:14:04 +03:00
|
|
|
void startUpTorrents();
|
2011-02-26 22:56:15 +03:00
|
|
|
void recheckTorrent(const QString &hash);
|
2010-01-24 14:57:15 +03:00
|
|
|
void useAlternativeSpeedsLimit(bool alternative);
|
2014-05-14 02:09:45 +04:00
|
|
|
qlonglong getETA(const QString& hash, const libtorrent::torrent_status &status) const;
|
2009-11-19 11:14:04 +03:00
|
|
|
/* Needed by Web UI */
|
|
|
|
void pauseAllTorrents();
|
2011-02-26 22:56:15 +03:00
|
|
|
void pauseTorrent(const QString &hash);
|
|
|
|
void resumeTorrent(const QString &hash);
|
2009-11-19 11:14:04 +03:00
|
|
|
void resumeAllTorrents();
|
|
|
|
/* End Web UI */
|
|
|
|
void preAllocateAllFiles(bool b);
|
|
|
|
void saveFastResumeData();
|
2010-12-25 17:47:52 +03:00
|
|
|
void enableIPFilter(const QString &filter_path, bool force=false);
|
2009-11-19 11:14:04 +03:00
|
|
|
void disableIPFilter();
|
|
|
|
void setQueueingEnabled(bool enable);
|
|
|
|
void handleDownloadFailure(QString url, QString reason);
|
2013-03-01 23:25:38 +04:00
|
|
|
void downloadUrlAndSkipDialog(QString url, QString save_path=QString(), QString label=QString(), const QList<QNetworkCookie>& cookies = QList<QNetworkCookie>());
|
2009-11-19 11:14:04 +03:00
|
|
|
// Session configuration - Setters
|
|
|
|
void setListeningPort(int port);
|
|
|
|
void setMaxConnectionsPerTorrent(int max);
|
|
|
|
void setMaxUploadsPerTorrent(int max);
|
|
|
|
void setDownloadRateLimit(long rate);
|
|
|
|
void setUploadRateLimit(long rate);
|
2011-03-07 22:26:44 +03:00
|
|
|
void setGlobalMaxRatio(qreal ratio);
|
|
|
|
qreal getGlobalMaxRatio() const { return global_ratio_limit; }
|
|
|
|
void setMaxRatioPerTorrent(const QString &hash, qreal ratio);
|
|
|
|
qreal getMaxRatioPerTorrent(const QString &hash, bool *usesGlobalRatio) const;
|
|
|
|
void removeRatioPerTorrent(const QString &hash);
|
2014-01-01 04:49:16 +04:00
|
|
|
#if LIBTORRENT_VERSION_NUM < 10000
|
2009-11-19 11:14:04 +03:00
|
|
|
void setDHTPort(int dht_port);
|
2014-01-01 04:49:16 +04:00
|
|
|
#endif
|
2011-05-01 15:22:17 +04:00
|
|
|
void setProxySettings(libtorrent::proxy_settings proxySettings);
|
2010-11-23 00:55:32 +03:00
|
|
|
void setSessionSettings(const libtorrent::session_settings &sessionSettings);
|
2012-12-01 16:48:08 +04:00
|
|
|
void setDefaultSavePath(const QString &savepath);
|
|
|
|
void setDefaultTempPath(const QString &temppath);
|
2009-12-17 23:28:30 +03:00
|
|
|
void setAppendLabelToSavePath(bool append);
|
2010-11-24 23:31:14 +03:00
|
|
|
void appendLabelToTorrentSavePath(const QTorrentHandle &h);
|
|
|
|
void changeLabelInTorrentSavePath(const QTorrentHandle &h, QString old_label, QString new_label);
|
|
|
|
void appendqBextensionToTorrent(const QTorrentHandle &h, bool append);
|
2009-12-18 16:36:47 +03:00
|
|
|
void setAppendqBExtension(bool append);
|
2010-11-23 00:55:32 +03:00
|
|
|
void applyEncryptionSettings(libtorrent::pe_settings se);
|
2009-11-19 11:14:04 +03:00
|
|
|
void setDownloadLimit(QString hash, long val);
|
|
|
|
void setUploadLimit(QString hash, long val);
|
|
|
|
void enableUPnP(bool b);
|
|
|
|
void enableLSD(bool b);
|
|
|
|
bool enableDHT(bool b);
|
2010-01-03 01:20:37 +03:00
|
|
|
#ifdef DISABLE_GUI
|
|
|
|
void addConsoleMessage(QString msg, QString color=QString::null);
|
|
|
|
#else
|
2009-11-19 11:14:04 +03:00
|
|
|
void addConsoleMessage(QString msg, QColor color=QApplication::palette().color(QPalette::WindowText));
|
2010-01-03 01:20:37 +03:00
|
|
|
#endif
|
2009-11-19 11:14:04 +03:00
|
|
|
void addPeerBanMessage(QString msg, bool from_ipfilter);
|
2013-02-28 14:21:28 +04:00
|
|
|
void clearConsoleMessages() { consoleMessages.clear(); }
|
|
|
|
void clearPeerBanMessages() { peerBanMessages.clear(); }
|
2009-11-19 11:14:04 +03:00
|
|
|
void processDownloadedFile(QString, QString);
|
2012-06-24 17:46:41 +04:00
|
|
|
void addMagnetSkipAddDlg(const QString& uri, const QString& save_path = QString(), const QString& label = QString());
|
2012-06-24 11:27:32 +04:00
|
|
|
void addMagnetInteractive(const QString& uri);
|
2009-11-19 11:14:04 +03:00
|
|
|
void downloadFromURLList(const QStringList& urls);
|
|
|
|
void configureSession();
|
|
|
|
void banIP(QString ip);
|
2010-03-20 14:30:11 +03:00
|
|
|
void recursiveTorrentDownload(const QTorrentHandle &h);
|
2013-09-18 01:44:18 +04:00
|
|
|
void unhideMagnet(const QString &hash);
|
2007-03-05 16:55:23 +03:00
|
|
|
|
2010-12-25 17:07:28 +03:00
|
|
|
private:
|
2012-05-15 20:57:31 +04:00
|
|
|
QString getSavePath(const QString &hash, bool fromScanDir = false, QString filePath = QString::null);
|
2011-02-26 22:56:15 +03:00
|
|
|
bool loadFastResumeData(const QString &hash, std::vector<char> &buf);
|
|
|
|
void loadTorrentSettings(QTorrentHandle &h);
|
|
|
|
void loadTorrentTempData(QTorrentHandle &h, QString savePath, bool magnet);
|
2013-10-22 23:29:25 +04:00
|
|
|
void initializeAddTorrentParams(const QString &hash, libtorrent::add_torrent_params &p);
|
2011-03-07 22:26:44 +03:00
|
|
|
void updateRatioTimer();
|
2013-09-29 22:32:27 +04:00
|
|
|
void recoverPersistentData(const QString &hash, const std::vector<char> &buf);
|
|
|
|
void backupPersistentData(const QString &hash, boost::shared_ptr<libtorrent::entry> data);
|
2014-05-17 13:04:33 +04:00
|
|
|
void handleAlert(libtorrent::alert* a);
|
2014-05-31 00:58:07 +04:00
|
|
|
void handleTorrentFinishedAlert(libtorrent::torrent_finished_alert* p);
|
|
|
|
void handleSaveResumeDataAlert(libtorrent::save_resume_data_alert* p);
|
|
|
|
void handleFileRenamedAlert(libtorrent::file_renamed_alert* p);
|
|
|
|
void handleTorrentDeletedAlert(libtorrent::torrent_deleted_alert* p);
|
|
|
|
void handleStorageMovedAlert(libtorrent::storage_moved_alert* p);
|
2014-06-18 00:43:25 +04:00
|
|
|
void handleStorageMovedFailedAlert(libtorrent::storage_moved_failed_alert* p);
|
2014-05-31 00:58:07 +04:00
|
|
|
void handleMetadataReceivedAlert(libtorrent::metadata_received_alert* p);
|
|
|
|
void handleFileErrorAlert(libtorrent::file_error_alert* p);
|
|
|
|
void handleFileCompletedAlert(libtorrent::file_completed_alert* p);
|
|
|
|
void handleTorrentPausedAlert(libtorrent::torrent_paused_alert* p);
|
|
|
|
void handleTrackerErrorAlert(libtorrent::tracker_error_alert* p);
|
|
|
|
void handleTrackerReplyAlert(libtorrent::tracker_reply_alert* p);
|
|
|
|
void handleTrackerWarningAlert(libtorrent::tracker_warning_alert* p);
|
|
|
|
void handlePortmapWarningAlert(libtorrent::portmap_error_alert* p);
|
|
|
|
void handlePortmapAlert(libtorrent::portmap_alert* p);
|
|
|
|
void handlePeerBlockedAlert(libtorrent::peer_blocked_alert* p);
|
|
|
|
void handlePeerBanAlert(libtorrent::peer_ban_alert* p);
|
|
|
|
void handleFastResumeRejectedAlert(libtorrent::fastresume_rejected_alert* p);
|
|
|
|
void handleUrlSeedAlert(libtorrent::url_seed_alert* p);
|
|
|
|
void handleListenSucceededAlert(libtorrent::listen_succeeded_alert *p);
|
|
|
|
void handleListenFailedAlert(libtorrent::listen_failed_alert *p);
|
|
|
|
void handleTorrentCheckedAlert(libtorrent::torrent_checked_alert* p);
|
|
|
|
void handleExternalIPAlert(libtorrent::external_ip_alert *p);
|
|
|
|
void handleStateUpdateAlert(libtorrent::state_update_alert *p);
|
|
|
|
void handleStatsAlert(libtorrent::stats_alert *p);
|
2010-03-03 22:04:34 +03:00
|
|
|
|
2010-12-25 17:07:28 +03:00
|
|
|
private slots:
|
2009-11-19 11:14:04 +03:00
|
|
|
void addTorrentsFromScanFolder(QStringList&);
|
|
|
|
void readAlerts();
|
2010-06-22 21:06:11 +04:00
|
|
|
void processBigRatios();
|
2010-01-31 16:09:46 +03:00
|
|
|
void exportTorrentFiles(QString path);
|
2010-03-21 00:21:42 +03:00
|
|
|
void saveTempFastResumeData();
|
2011-02-26 22:56:15 +03:00
|
|
|
void sendNotificationEmail(const QTorrentHandle &h);
|
2014-01-26 16:26:24 +04:00
|
|
|
void autoRunExternalProgram(const QTorrentHandle &h);
|
2012-09-23 12:09:01 +04:00
|
|
|
void mergeTorrents(QTorrentHandle& h_ex, boost::intrusive_ptr<libtorrent::torrent_info> t);
|
|
|
|
void mergeTorrents(QTorrentHandle& h_ex, const QString& magnet_uri);
|
2012-08-21 11:16:49 +04:00
|
|
|
void exportTorrentFile(const QTorrentHandle &h, TorrentExportFolder folder = RegularTorrentExportFolder);
|
2010-11-29 19:55:23 +03:00
|
|
|
void initWebUi();
|
2010-12-25 17:07:28 +03:00
|
|
|
void handleIPFilterParsed(int ruleCount);
|
|
|
|
void handleIPFilterError();
|
2007-03-05 16:55:23 +03:00
|
|
|
|
2009-11-19 11:14:04 +03:00
|
|
|
signals:
|
2010-11-14 18:28:22 +03:00
|
|
|
void addedTorrent(const QTorrentHandle& h);
|
2011-02-26 22:56:15 +03:00
|
|
|
void deletedTorrent(const QString &hash);
|
2010-11-14 21:46:16 +03:00
|
|
|
void torrentAboutToBeRemoved(const QTorrentHandle &h);
|
2010-11-24 23:31:14 +03:00
|
|
|
void pausedTorrent(const QTorrentHandle& h);
|
|
|
|
void resumedTorrent(const QTorrentHandle& h);
|
|
|
|
void finishedTorrent(const QTorrentHandle& h);
|
|
|
|
void fullDiskError(const QTorrentHandle& h, QString msg);
|
2011-02-26 22:56:15 +03:00
|
|
|
void trackerError(const QString &hash, QString time, QString msg);
|
2010-11-24 23:31:14 +03:00
|
|
|
void trackerAuthenticationRequired(const QTorrentHandle& h);
|
2009-11-19 11:14:04 +03:00
|
|
|
void newDownloadedTorrent(QString path, QString url);
|
2013-07-09 17:33:00 +04:00
|
|
|
void newDownloadedTorrentFromRss(QString url);
|
2012-06-24 11:27:32 +04:00
|
|
|
void newMagnetLink(const QString& link);
|
2011-02-26 22:56:15 +03:00
|
|
|
void updateFileSize(const QString &hash);
|
2009-11-19 11:14:04 +03:00
|
|
|
void downloadFromUrlFailure(QString url, QString reason);
|
2010-11-24 23:31:14 +03:00
|
|
|
void torrentFinishedChecking(const QTorrentHandle& h);
|
|
|
|
void metadataReceived(const QTorrentHandle &h);
|
|
|
|
void savePathChanged(const QTorrentHandle &h);
|
2010-12-20 21:07:36 +03:00
|
|
|
void newConsoleMessage(const QString &msg);
|
|
|
|
void newBanMessage(const QString &msg);
|
2010-01-24 14:57:15 +03:00
|
|
|
void alternativeSpeedsModeChanged(bool alternative);
|
2010-11-24 23:31:14 +03:00
|
|
|
void recursiveTorrentDownloadPossible(const QTorrentHandle &h);
|
2010-12-25 17:47:52 +03:00
|
|
|
void ipFilterParsed(bool error, int ruleCount);
|
2013-09-18 01:44:18 +04:00
|
|
|
void metadataReceivedHidden(const QTorrentHandle &h);
|
2014-05-18 12:07:49 +04:00
|
|
|
void stateUpdate(const std::vector<libtorrent::torrent_status> &statuses);
|
2014-05-25 00:30:30 +04:00
|
|
|
void statsReceived(const libtorrent::stats_alert&);
|
2010-03-03 22:04:34 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
// Bittorrent
|
2010-11-23 00:55:32 +03:00
|
|
|
libtorrent::session *s;
|
2010-03-03 22:04:34 +03:00
|
|
|
QPointer<BandwidthScheduler> bd_scheduler;
|
2011-03-03 22:20:49 +03:00
|
|
|
QMap<QUrl, QPair<QString, QString> > savepathLabel_fromurl; // Use QMap for compatibility with Qt < 4.7: qHash(QUrl)
|
2010-03-03 22:04:34 +03:00
|
|
|
QHash<QString, QHash<QString, TrackerInfos> > trackersInfos;
|
2010-07-18 00:55:40 +04:00
|
|
|
QHash<QString, QString> savePathsToRemove;
|
2010-03-03 22:04:34 +03:00
|
|
|
QStringList torrentsToPausedAfterChecking;
|
2010-03-21 00:21:42 +03:00
|
|
|
QTimer resumeDataTimer;
|
2010-03-03 22:04:34 +03:00
|
|
|
// Ratio
|
|
|
|
QPointer<QTimer> BigRatioTimer;
|
|
|
|
// HTTP
|
2011-01-24 20:58:57 +03:00
|
|
|
DownloadThread* downloader;
|
2010-03-03 22:04:34 +03:00
|
|
|
// File System
|
|
|
|
ScanFoldersModel *m_scanFolders;
|
|
|
|
// Console / Log
|
|
|
|
QStringList consoleMessages;
|
|
|
|
QStringList peerBanMessages;
|
|
|
|
// Settings
|
|
|
|
bool preAllocateAll;
|
2011-03-07 22:26:44 +03:00
|
|
|
qreal global_ratio_limit;
|
2010-06-22 21:06:11 +04:00
|
|
|
int high_ratio_action;
|
2010-03-03 22:04:34 +03:00
|
|
|
bool LSDEnabled;
|
|
|
|
bool DHTEnabled;
|
|
|
|
int current_dht_port;
|
|
|
|
bool PeXEnabled;
|
|
|
|
bool queueingEnabled;
|
|
|
|
bool appendLabelToSavePath;
|
2012-08-21 11:16:49 +04:00
|
|
|
bool m_torrentExportEnabled;
|
|
|
|
bool m_finishedTorrentExportEnabled;
|
2010-03-03 22:04:34 +03:00
|
|
|
bool appendqBExtension;
|
|
|
|
QString defaultSavePath;
|
|
|
|
QString defaultTempPath;
|
|
|
|
// IP filtering
|
|
|
|
QPointer<FilterParserThread> filterParser;
|
|
|
|
QString filterPath;
|
|
|
|
// Web UI
|
|
|
|
QPointer<HttpServer> httpServer;
|
|
|
|
QList<QUrl> url_skippingDlg;
|
|
|
|
// GeoIP
|
|
|
|
#ifndef DISABLE_GUI
|
|
|
|
bool geoipDBLoaded;
|
|
|
|
bool resolve_countries;
|
|
|
|
#endif
|
2010-10-16 01:55:56 +04:00
|
|
|
// Tracker
|
|
|
|
QPointer<QTracker> m_tracker;
|
2010-12-18 18:34:38 +03:00
|
|
|
TorrentSpeedMonitor *m_speedMonitor;
|
2011-04-05 20:22:16 +04:00
|
|
|
shutDownAction m_shutdownAct;
|
2011-04-12 23:50:05 +04:00
|
|
|
// Port forwarding
|
2014-01-01 04:49:16 +04:00
|
|
|
#if LIBTORRENT_VERSION_NUM < 10000
|
2011-04-12 23:50:05 +04:00
|
|
|
libtorrent::upnp *m_upnp;
|
|
|
|
libtorrent::natpmp *m_natpmp;
|
2014-01-01 02:10:41 +04:00
|
|
|
#endif
|
2011-04-15 17:02:39 +04:00
|
|
|
// DynDNS
|
|
|
|
DNSUpdater *m_dynDNSUpdater;
|
2014-05-17 13:04:33 +04:00
|
|
|
QAlertDispatcher* m_alertDispatcher;
|
2014-05-24 16:24:33 +04:00
|
|
|
TorrentStatistics* m_torrentStatistics;
|
2007-03-05 20:35:38 +03:00
|
|
|
};
|
2007-03-05 16:55:23 +03:00
|
|
|
|
|
|
|
#endif
|