1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 07:18:08 +00:00

Follow project coding style. Issue #2192.

This commit is contained in:
sledgehammer999 2015-02-23 19:44:29 +02:00
parent 89db090cb9
commit 92757b9f22
2 changed files with 1893 additions and 1484 deletions

File diff suppressed because it is too large Load Diff

View File

@ -43,450 +43,491 @@
#include <libtorrent/version.hpp> #include <libtorrent/version.hpp>
enum scheduler_days { EVERY_DAY, WEEK_DAYS, WEEK_ENDS, MON, TUE, WED, THU, FRI, SAT, SUN }; enum scheduler_days
enum maxRatioAction {PAUSE_ACTION, REMOVE_ACTION}; {
namespace Proxy { EVERY_DAY,
enum ProxyType {HTTP=1, SOCKS5=2, HTTP_PW=3, SOCKS5_PW=4, SOCKS4=5}; WEEK_DAYS,
} WEEK_ENDS,
namespace TrayIcon { MON,
enum Style { NORMAL = 0, MONO_DARK, MONO_LIGHT }; TUE,
} WED,
namespace DNS { THU,
enum Service { DYNDNS, NOIP, NONE = -1 }; FRI,
SAT,
SUN
};
enum maxRatioAction
{
PAUSE_ACTION,
REMOVE_ACTION
};
namespace Proxy
{
enum ProxyType
{
HTTP = 1,
SOCKS5 = 2,
HTTP_PW = 3,
SOCKS5_PW = 4,
SOCKS4 = 5
};
} }
class Preferences : public QObject { namespace TrayIcon
Q_OBJECT {
Q_DISABLE_COPY(Preferences) enum Style
{
NORMAL = 0,
MONO_DARK,
MONO_LIGHT
};
}
namespace DNS
{
enum Service
{
DYNDNS,
NOIP,
NONE = -1
};
}
class Preferences: public QObject
{
Q_OBJECT
Q_DISABLE_COPY(Preferences)
private: private:
explicit Preferences(); explicit Preferences();
static Preferences* m_instance; static Preferences* m_instance;
QHash<QString, QVariant> m_data; QHash<QString, QVariant> m_data;
int m_randomPort; int m_randomPort;
bool dirty; bool dirty;
QTimer timer; QTimer timer;
mutable QReadWriteLock lock; mutable QReadWriteLock lock;
const QVariant value(const QString &key, const QVariant &defaultValue = QVariant()) const; const QVariant value(const QString &key, const QVariant &defaultValue = QVariant()) const;
void setValue(const QString &key, const QVariant &value); void setValue(const QString &key, const QVariant &value);
signals: signals:
void changed(); void changed();
public slots: public slots:
void save(); void save();
public: public:
static Preferences* instance(); static Preferences* instance();
static void drop(); static void drop();
~Preferences(); ~Preferences();
// General options // General options
QString getLocale() const; QString getLocale() const;
void setLocale(const QString &locale); void setLocale(const QString &locale);
bool useProgramNotification() const; bool useProgramNotification() const;
void useProgramNotification(bool use); void useProgramNotification(bool use);
bool deleteTorrentFilesAsDefault() const; bool deleteTorrentFilesAsDefault() const;
void setDeleteTorrentFilesAsDefault(bool del); void setDeleteTorrentFilesAsDefault(bool del);
bool confirmOnExit() const; bool confirmOnExit() const;
void setConfirmOnExit(bool confirm); void setConfirmOnExit(bool confirm);
bool speedInTitleBar() const; bool speedInTitleBar() const;
void showSpeedInTitleBar(bool show); void showSpeedInTitleBar(bool show);
bool useAlternatingRowColors() const; bool useAlternatingRowColors() const;
void setAlternatingRowColors(bool b); void setAlternatingRowColors(bool b);
bool useRandomPort() const; bool useRandomPort() const;
void setRandomPort(bool b); void setRandomPort(bool b);
bool systrayIntegration() const; bool systrayIntegration() const;
void setSystrayIntegration(bool enabled); void setSystrayIntegration(bool enabled);
bool isToolbarDisplayed() const; bool isToolbarDisplayed() const;
void setToolbarDisplayed(bool displayed); void setToolbarDisplayed(bool displayed);
bool minimizeToTray() const; bool minimizeToTray() const;
void setMinimizeToTray(bool b); void setMinimizeToTray(bool b);
bool closeToTray() const; bool closeToTray() const;
void setCloseToTray(bool b); void setCloseToTray(bool b);
bool startMinimized() const; bool startMinimized() const;
void setStartMinimized(bool b); void setStartMinimized(bool b);
bool isSplashScreenDisabled() const; bool isSplashScreenDisabled() const;
void setSplashScreenDisabled(bool b); void setSplashScreenDisabled(bool b);
bool preventFromSuspend() const; bool preventFromSuspend() const;
void setPreventFromSuspend(bool b); void setPreventFromSuspend(bool b);
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
bool WinStartup() const; bool WinStartup() const;
void setWinStartup(bool b); void setWinStartup(bool b);
#endif #endif
// Downloads // Downloads
QString getSavePath() const; QString getSavePath() const;
void setSavePath(const QString &save_path); void setSavePath(const QString &save_path);
bool isTempPathEnabled() const; bool isTempPathEnabled() const;
void setTempPathEnabled(bool enabled); void setTempPathEnabled(bool enabled);
QString getTempPath() const; QString getTempPath() const;
void setTempPath(const QString &path); void setTempPath(const QString &path);
bool useIncompleteFilesExtension() const; bool useIncompleteFilesExtension() const;
void useIncompleteFilesExtension(bool enabled); void useIncompleteFilesExtension(bool enabled);
bool appendTorrentLabel() const; bool appendTorrentLabel() const;
void setAppendTorrentLabel(bool b); void setAppendTorrentLabel(bool b);
QString lastLocationPath() const; QString lastLocationPath() const;
void setLastLocationPath(const QString &path); void setLastLocationPath(const QString &path);
bool preAllocateAllFiles() const; bool preAllocateAllFiles() const;
void preAllocateAllFiles(bool enabled); void preAllocateAllFiles(bool enabled);
bool useAdditionDialog() const; bool useAdditionDialog() const;
void useAdditionDialog(bool b); void useAdditionDialog(bool b);
bool additionDialogFront() const; bool additionDialogFront() const;
void additionDialogFront(bool b); void additionDialogFront(bool b);
bool addTorrentsInPause() const; bool addTorrentsInPause() const;
void addTorrentsInPause(bool b); void addTorrentsInPause(bool b);
QStringList getScanDirs() const; QStringList getScanDirs() const;
void setScanDirs(const QStringList &dirs); void setScanDirs(const QStringList &dirs);
QList<bool> getDownloadInScanDirs() const; QList<bool> getDownloadInScanDirs() const;
void setDownloadInScanDirs(const QList<bool> &list); void setDownloadInScanDirs(const QList<bool> &list);
QString getScanDirsLastPath() const; QString getScanDirsLastPath() const;
void setScanDirsLastPath(const QString &path); void setScanDirsLastPath(const QString &path);
bool isTorrentExportEnabled() const; bool isTorrentExportEnabled() const;
QString getTorrentExportDir() const; QString getTorrentExportDir() const;
void setTorrentExportDir(QString path); void setTorrentExportDir(QString path);
bool isFinishedTorrentExportEnabled() const; bool isFinishedTorrentExportEnabled() const;
QString getFinishedTorrentExportDir() const; QString getFinishedTorrentExportDir() const;
void setFinishedTorrentExportDir(QString path); void setFinishedTorrentExportDir(QString path);
bool isMailNotificationEnabled() const; bool isMailNotificationEnabled() const;
void setMailNotificationEnabled(bool enabled); void setMailNotificationEnabled(bool enabled);
QString getMailNotificationEmail() const; QString getMailNotificationEmail() const;
void setMailNotificationEmail(const QString &mail); void setMailNotificationEmail(const QString &mail);
QString getMailNotificationSMTP() const; QString getMailNotificationSMTP() const;
void setMailNotificationSMTP(const QString &smtp_server); void setMailNotificationSMTP(const QString &smtp_server);
bool getMailNotificationSMTPSSL() const; bool getMailNotificationSMTPSSL() const;
void setMailNotificationSMTPSSL(bool use); void setMailNotificationSMTPSSL(bool use);
bool getMailNotificationSMTPAuth() const; bool getMailNotificationSMTPAuth() const;
void setMailNotificationSMTPAuth(bool use); void setMailNotificationSMTPAuth(bool use);
QString getMailNotificationSMTPUsername() const; QString getMailNotificationSMTPUsername() const;
void setMailNotificationSMTPUsername(const QString &username); void setMailNotificationSMTPUsername(const QString &username);
QString getMailNotificationSMTPPassword() const; QString getMailNotificationSMTPPassword() const;
void setMailNotificationSMTPPassword(const QString &password); void setMailNotificationSMTPPassword(const QString &password);
int getActionOnDblClOnTorrentDl() const; int getActionOnDblClOnTorrentDl() const;
void setActionOnDblClOnTorrentDl(int act); void setActionOnDblClOnTorrentDl(int act);
int getActionOnDblClOnTorrentFn() const; int getActionOnDblClOnTorrentFn() const;
void setActionOnDblClOnTorrentFn(int act); void setActionOnDblClOnTorrentFn(int act);
// Connection options // Connection options
int getSessionPort() const; int getSessionPort() const;
void setSessionPort(int port); void setSessionPort(int port);
bool isUPnPEnabled() const; bool isUPnPEnabled() const;
void setUPnPEnabled(bool enabled); void setUPnPEnabled(bool enabled);
int getGlobalDownloadLimit() const; int getGlobalDownloadLimit() const;
void setGlobalDownloadLimit(int limit); void setGlobalDownloadLimit(int limit);
int getGlobalUploadLimit() const; int getGlobalUploadLimit() const;
void setGlobalUploadLimit(int limit); void setGlobalUploadLimit(int limit);
int getAltGlobalDownloadLimit() const; int getAltGlobalDownloadLimit() const;
void setAltGlobalDownloadLimit(int limit); void setAltGlobalDownloadLimit(int limit);
int getAltGlobalUploadLimit() const; int getAltGlobalUploadLimit() const;
void setAltGlobalUploadLimit(int limit); void setAltGlobalUploadLimit(int limit);
bool isAltBandwidthEnabled() const; bool isAltBandwidthEnabled() const;
void setAltBandwidthEnabled(bool enabled); void setAltBandwidthEnabled(bool enabled);
bool isSchedulerEnabled() const; bool isSchedulerEnabled() const;
void setSchedulerEnabled(bool enabled); void setSchedulerEnabled(bool enabled);
QTime getSchedulerStartTime() const; QTime getSchedulerStartTime() const;
void setSchedulerStartTime(const QTime &time); void setSchedulerStartTime(const QTime &time);
QTime getSchedulerEndTime() const; QTime getSchedulerEndTime() const;
void setSchedulerEndTime(const QTime &time); void setSchedulerEndTime(const QTime &time);
scheduler_days getSchedulerDays() const; scheduler_days getSchedulerDays() const;
void setSchedulerDays(scheduler_days days); void setSchedulerDays(scheduler_days days);
// Proxy options // Proxy options
bool isProxyEnabled() const; bool isProxyEnabled() const;
bool isProxyAuthEnabled() const; bool isProxyAuthEnabled() const;
void setProxyAuthEnabled(bool enabled); void setProxyAuthEnabled(bool enabled);
QString getProxyIp() const; QString getProxyIp() const;
void setProxyIp(const QString &ip); void setProxyIp(const QString &ip);
unsigned short getProxyPort() const; unsigned short getProxyPort() const;
void setProxyPort(unsigned short port); void setProxyPort(unsigned short port);
QString getProxyUsername() const; QString getProxyUsername() const;
void setProxyUsername(const QString &username); void setProxyUsername(const QString &username);
QString getProxyPassword() const; QString getProxyPassword() const;
void setProxyPassword(const QString &password); void setProxyPassword(const QString &password);
int getProxyType() const; int getProxyType() const;
void setProxyType(int type); void setProxyType(int type);
bool proxyPeerConnections() const; bool proxyPeerConnections() const;
void setProxyPeerConnections(bool enabled); void setProxyPeerConnections(bool enabled);
#if LIBTORRENT_VERSION_NUM >= 10000 #if LIBTORRENT_VERSION_NUM >= 10000
bool getForceProxy() const; bool getForceProxy() const;
void setForceProxy(bool enabled); void setForceProxy(bool enabled);
#endif #endif
// Bittorrent options // Bittorrent options
int getMaxConnecs() const; int getMaxConnecs() const;
void setMaxConnecs(int val); void setMaxConnecs(int val);
int getMaxConnecsPerTorrent() const; int getMaxConnecsPerTorrent() const;
void setMaxConnecsPerTorrent(int val); void setMaxConnecsPerTorrent(int val);
int getMaxUploads() const; int getMaxUploads() const;
void setMaxUploads(int val); void setMaxUploads(int val);
int getMaxUploadsPerTorrent() const; int getMaxUploadsPerTorrent() const;
void setMaxUploadsPerTorrent(int val); void setMaxUploadsPerTorrent(int val);
bool isuTPEnabled() const; bool isuTPEnabled() const;
void setuTPEnabled(bool enabled); void setuTPEnabled(bool enabled);
bool isuTPRateLimited() const; bool isuTPRateLimited() const;
void setuTPRateLimited(bool enabled); void setuTPRateLimited(bool enabled);
bool isDHTEnabled() const; bool isDHTEnabled() const;
void setDHTEnabled(bool enabled); void setDHTEnabled(bool enabled);
bool isPeXEnabled() const; bool isPeXEnabled() const;
void setPeXEnabled(bool enabled); void setPeXEnabled(bool enabled);
bool isLSDEnabled() const; bool isLSDEnabled() const;
void setLSDEnabled(bool enabled); void setLSDEnabled(bool enabled);
int getEncryptionSetting() const; int getEncryptionSetting() const;
void setEncryptionSetting(int val); void setEncryptionSetting(int val);
qreal getGlobalMaxRatio() const; qreal getGlobalMaxRatio() const;
void setGlobalMaxRatio(qreal ratio); void setGlobalMaxRatio(qreal ratio);
int getMaxRatioAction() const; int getMaxRatioAction() const;
void setMaxRatioAction(int act); void setMaxRatioAction(int act);
// IP Filter // IP Filter
bool isFilteringEnabled() const; bool isFilteringEnabled() const;
void setFilteringEnabled(bool enabled); void setFilteringEnabled(bool enabled);
QString getFilter() const; QString getFilter() const;
void setFilter(const QString &path); void setFilter(const QString &path);
QStringList bannedIPs() const; QStringList bannedIPs() const;
void banIP(const QString &ip); void banIP(const QString &ip);
// Search // Search
bool isSearchEnabled() const; bool isSearchEnabled() const;
void setSearchEnabled(bool enabled); void setSearchEnabled(bool enabled);
// Execution Log // Execution Log
bool isExecutionLogEnabled() const; bool isExecutionLogEnabled() const;
void setExecutionLogEnabled(bool b); void setExecutionLogEnabled(bool b);
// Queueing system // Queueing system
bool isQueueingSystemEnabled() const; bool isQueueingSystemEnabled() const;
void setQueueingSystemEnabled(bool enabled); void setQueueingSystemEnabled(bool enabled);
int getMaxActiveDownloads() const; int getMaxActiveDownloads() const;
void setMaxActiveDownloads(int val); void setMaxActiveDownloads(int val);
int getMaxActiveUploads() const; int getMaxActiveUploads() const;
void setMaxActiveUploads(int val); void setMaxActiveUploads(int val);
int getMaxActiveTorrents() const; int getMaxActiveTorrents() const;
void setMaxActiveTorrents(int val); void setMaxActiveTorrents(int val);
bool ignoreSlowTorrentsForQueueing() const; bool ignoreSlowTorrentsForQueueing() const;
void setIgnoreSlowTorrentsForQueueing(bool ignore); void setIgnoreSlowTorrentsForQueueing(bool ignore);
bool isWebUiEnabled() const; bool isWebUiEnabled() const;
void setWebUiEnabled(bool enabled); void setWebUiEnabled(bool enabled);
bool isWebUiLocalAuthEnabled() const; bool isWebUiLocalAuthEnabled() const;
void setWebUiLocalAuthEnabled(bool enabled); void setWebUiLocalAuthEnabled(bool enabled);
quint16 getWebUiPort() const; quint16 getWebUiPort() const;
void setWebUiPort(quint16 port); void setWebUiPort(quint16 port);
bool useUPnPForWebUIPort() const; bool useUPnPForWebUIPort() const;
void setUPnPForWebUIPort(bool enabled); void setUPnPForWebUIPort(bool enabled);
QString getWebUiUsername() const; QString getWebUiUsername() const;
void setWebUiUsername(const QString &username); void setWebUiUsername(const QString &username);
QString getWebUiPassword() const; QString getWebUiPassword() const;
void setWebUiPassword(const QString &new_password); void setWebUiPassword(const QString &new_password);
bool isWebUiHttpsEnabled() const; bool isWebUiHttpsEnabled() const;
void setWebUiHttpsEnabled(bool enabled); void setWebUiHttpsEnabled(bool enabled);
QByteArray getWebUiHttpsCertificate() const; QByteArray getWebUiHttpsCertificate() const;
void setWebUiHttpsCertificate(const QByteArray &data); void setWebUiHttpsCertificate(const QByteArray &data);
QByteArray getWebUiHttpsKey() const; QByteArray getWebUiHttpsKey() const;
void setWebUiHttpsKey(const QByteArray &data); void setWebUiHttpsKey(const QByteArray &data);
bool isDynDNSEnabled() const; bool isDynDNSEnabled() const;
void setDynDNSEnabled(bool enabled); void setDynDNSEnabled(bool enabled);
DNS::Service getDynDNSService() const; DNS::Service getDynDNSService() const;
void setDynDNSService(int service); void setDynDNSService(int service);
QString getDynDomainName() const; QString getDynDomainName() const;
void setDynDomainName(const QString &name); void setDynDomainName(const QString &name);
QString getDynDNSUsername() const; QString getDynDNSUsername() const;
void setDynDNSUsername(const QString &username); void setDynDNSUsername(const QString &username);
QString getDynDNSPassword() const; QString getDynDNSPassword() const;
void setDynDNSPassword(const QString &password); void setDynDNSPassword(const QString &password);
// Advanced settings // Advanced settings
void setUILockPassword(const QString &clear_password); void setUILockPassword(const QString &clear_password);
void clearUILockPassword(); void clearUILockPassword();
QString getUILockPasswordMD5() const; QString getUILockPasswordMD5() const;
bool isUILocked() const; bool isUILocked() const;
void setUILocked(bool locked); void setUILocked(bool locked);
bool isAutoRunEnabled() const; bool isAutoRunEnabled() const;
void setAutoRunEnabled(bool enabled); void setAutoRunEnabled(bool enabled);
QString getAutoRunProgram() const; QString getAutoRunProgram() const;
void setAutoRunProgram(const QString &program); void setAutoRunProgram(const QString &program);
bool shutdownWhenDownloadsComplete() const; bool shutdownWhenDownloadsComplete() const;
void setShutdownWhenDownloadsComplete(bool shutdown); void setShutdownWhenDownloadsComplete(bool shutdown);
bool suspendWhenDownloadsComplete() const; bool suspendWhenDownloadsComplete() const;
void setSuspendWhenDownloadsComplete(bool suspend); void setSuspendWhenDownloadsComplete(bool suspend);
bool hibernateWhenDownloadsComplete() const; bool hibernateWhenDownloadsComplete() const;
void setHibernateWhenDownloadsComplete(bool hibernate); void setHibernateWhenDownloadsComplete(bool hibernate);
bool shutdownqBTWhenDownloadsComplete() const; bool shutdownqBTWhenDownloadsComplete() const;
void setShutdownqBTWhenDownloadsComplete(bool shutdown); void setShutdownqBTWhenDownloadsComplete(bool shutdown);
uint diskCacheSize() const; uint diskCacheSize() const;
void setDiskCacheSize(uint size); void setDiskCacheSize(uint size);
uint diskCacheTTL() const; uint diskCacheTTL() const;
void setDiskCacheTTL(uint ttl); void setDiskCacheTTL(uint ttl);
bool osCache() const; bool osCache() const;
void setOsCache(bool enable); void setOsCache(bool enable);
uint saveResumeDataInterval() const; uint saveResumeDataInterval() const;
void setSaveResumeDataInterval(uint m); void setSaveResumeDataInterval(uint m);
uint outgoingPortsMin() const; uint outgoingPortsMin() const;
void setOutgoingPortsMin(uint val); void setOutgoingPortsMin(uint val);
uint outgoingPortsMax() const; uint outgoingPortsMax() const;
void setOutgoingPortsMax(uint val); void setOutgoingPortsMax(uint val);
bool ignoreLimitsOnLAN() const; bool ignoreLimitsOnLAN() const;
void ignoreLimitsOnLAN(bool ignore); void ignoreLimitsOnLAN(bool ignore);
bool includeOverheadInLimits() const; bool includeOverheadInLimits() const;
void includeOverheadInLimits(bool include); void includeOverheadInLimits(bool include);
bool trackerExchangeEnabled() const; bool trackerExchangeEnabled() const;
void setTrackerExchangeEnabled(bool enable); void setTrackerExchangeEnabled(bool enable);
bool recheckTorrentsOnCompletion() const; bool recheckTorrentsOnCompletion() const;
void recheckTorrentsOnCompletion(bool recheck); void recheckTorrentsOnCompletion(bool recheck);
unsigned int getRefreshInterval() const; unsigned int getRefreshInterval() const;
void setRefreshInterval(uint interval); void setRefreshInterval(uint interval);
bool resolvePeerCountries() const; bool resolvePeerCountries() const;
void resolvePeerCountries(bool resolve); void resolvePeerCountries(bool resolve);
bool resolvePeerHostNames() const; bool resolvePeerHostNames() const;
void resolvePeerHostNames(bool resolve); void resolvePeerHostNames(bool resolve);
int getMaxHalfOpenConnections() const; int getMaxHalfOpenConnections() const;
void setMaxHalfOpenConnections(int value); void setMaxHalfOpenConnections(int value);
QString getNetworkInterface() const; QString getNetworkInterface() const;
void setNetworkInterface(const QString& iface); void setNetworkInterface(const QString& iface);
QString getNetworkInterfaceName() const; QString getNetworkInterfaceName() const;
void setNetworkInterfaceName(const QString& iface); void setNetworkInterfaceName(const QString& iface);
bool getListenIPv6() const; bool getListenIPv6() const;
void setListenIPv6(bool enable); void setListenIPv6(bool enable);
QString getNetworkAddress() const; QString getNetworkAddress() const;
void setNetworkAddress(const QString& addr); void setNetworkAddress(const QString& addr);
bool isAnonymousModeEnabled() const; bool isAnonymousModeEnabled() const;
void enableAnonymousMode(bool enabled); void enableAnonymousMode(bool enabled);
bool isSuperSeedingEnabled() const; bool isSuperSeedingEnabled() const;
void enableSuperSeeding(bool enabled); void enableSuperSeeding(bool enabled);
bool announceToAllTrackers() const; bool announceToAllTrackers() const;
void setAnnounceToAllTrackers(bool enabled); void setAnnounceToAllTrackers(bool enabled);
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC)) #if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
bool useSystemIconTheme() const; bool useSystemIconTheme() const;
void useSystemIconTheme(bool enabled); void useSystemIconTheme(bool enabled);
#endif #endif
QStringList getTorrentLabels() const; QStringList getTorrentLabels() const;
void setTorrentLabels(const QStringList& labels); void setTorrentLabels(const QStringList& labels);
void addTorrentLabel(const QString& label); void addTorrentLabel(const QString& label);
void removeTorrentLabel(const QString& label); void removeTorrentLabel(const QString& label);
bool recursiveDownloadDisabled() const; bool recursiveDownloadDisabled() const;
void disableRecursiveDownload(bool disable=true); void disableRecursiveDownload(bool disable = true);
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
static QString getPythonPath(); static QString getPythonPath();
bool neverCheckFileAssoc() const; bool neverCheckFileAssoc() const;
void setNeverCheckFileAssoc(bool check = true); void setNeverCheckFileAssoc(bool check = true);
static bool isTorrentFileAssocSet(); static bool isTorrentFileAssocSet();
static bool isMagnetLinkAssocSet(); static bool isMagnetLinkAssocSet();
static void setTorrentFileAssoc(bool set); static void setTorrentFileAssoc(bool set);
static void setMagnetLinkAssoc(bool set); static void setMagnetLinkAssoc(bool set);
#endif #endif
bool isTrackerEnabled() const; bool isTrackerEnabled() const;
void setTrackerEnabled(bool enabled); void setTrackerEnabled(bool enabled);
int getTrackerPort() const; int getTrackerPort() const;
void setTrackerPort(int port); void setTrackerPort(int port);
#if defined(Q_OS_WIN) || defined(Q_OS_MAC) #if defined(Q_OS_WIN) || defined(Q_OS_MAC)
bool isUpdateCheckEnabled() const; bool isUpdateCheckEnabled() const;
void setUpdateCheckEnabled(bool enabled); void setUpdateCheckEnabled(bool enabled);
#endif #endif
bool confirmTorrentDeletion() const; bool confirmTorrentDeletion() const;
void setConfirmTorrentDeletion(bool enabled); void setConfirmTorrentDeletion(bool enabled);
TrayIcon::Style trayIconStyle() const; TrayIcon::Style trayIconStyle() const;
void setTrayIconStyle(TrayIcon::Style style); void setTrayIconStyle(TrayIcon::Style style);
// Stuff that don't appear in the Options GUI but are saved // Stuff that don't appear in the Options GUI but are saved
// in the same file. // in the same file.
QByteArray getAddNewTorrentDialogState() const; QByteArray getAddNewTorrentDialogState() const;
void setAddNewTorrentDialogState(const QByteArray &state); void setAddNewTorrentDialogState(const QByteArray &state);
int getAddNewTorrentDialogPos() const; int getAddNewTorrentDialogPos() const;
void setAddNewTorrentDialogPos(const int &pos); void setAddNewTorrentDialogPos(const int &pos);
int getAddNewTorrentDialogWidth() const; int getAddNewTorrentDialogWidth() const;
void setAddNewTorrentDialogWidth(const int &width); void setAddNewTorrentDialogWidth(const int &width);
bool getAddNewTorrentDialogExpanded() const; bool getAddNewTorrentDialogExpanded() const;
void setAddNewTorrentDialogExpanded(const bool expanded); void setAddNewTorrentDialogExpanded(const bool expanded);
QStringList getAddNewTorrentDialogPathHistory() const; QStringList getAddNewTorrentDialogPathHistory() const;
void setAddNewTorrentDialogPathHistory(const QStringList &history); void setAddNewTorrentDialogPathHistory(const QStringList &history);
QDateTime getDNSLastUpd() const; QDateTime getDNSLastUpd() const;
void setDNSLastUpd(const QDateTime &date); void setDNSLastUpd(const QDateTime &date);
QString getDNSLastIP() const; QString getDNSLastIP() const;
void setDNSLastIP(const QString &ip); void setDNSLastIP(const QString &ip);
bool getAcceptedLegal() const; bool getAcceptedLegal() const;
void setAcceptedLegal(const bool accepted); void setAcceptedLegal(const bool accepted);
QByteArray getMainGeometry() const; QByteArray getMainGeometry() const;
void setMainGeometry(const QByteArray &geometry); void setMainGeometry(const QByteArray &geometry);
QByteArray getMainVSplitterState() const; QByteArray getMainVSplitterState() const;
void setMainVSplitterState(const QByteArray &state); void setMainVSplitterState(const QByteArray &state);
QString getMainLastDir() const; QString getMainLastDir() const;
void setMainLastDir(const QString &path); void setMainLastDir(const QString &path);
#ifndef DISABLE_GUI #ifndef DISABLE_GUI
QSize getPrefSize(const QSize &defaultSize) const; QSize getPrefSize(const QSize &defaultSize) const;
void setPrefSize(const QSize &size); void setPrefSize(const QSize &size);
#endif #endif
QPoint getPrefPos() const; QPoint getPrefPos() const;
void setPrefPos(const QPoint &pos); void setPrefPos(const QPoint &pos);
QStringList getPrefHSplitterSizes() const; QStringList getPrefHSplitterSizes() const;
void setPrefHSplitterSizes(const QStringList &sizes); void setPrefHSplitterSizes(const QStringList &sizes);
QByteArray getPeerListState() const; QByteArray getPeerListState() const;
void setPeerListState(const QByteArray &state); void setPeerListState(const QByteArray &state);
QString getPropSplitterSizes() const; QString getPropSplitterSizes() const;
void setPropSplitterSizes(const QString &sizes); void setPropSplitterSizes(const QString &sizes);
QByteArray getPropFileListState() const; QByteArray getPropFileListState() const;
void setPropFileListState(const QByteArray &state); void setPropFileListState(const QByteArray &state);
int getPropCurTab() const; int getPropCurTab() const;
void setPropCurTab(const int &tab); void setPropCurTab(const int &tab);
bool getPropVisible() const; bool getPropVisible() const;
void setPropVisible(const bool visible); void setPropVisible(const bool visible);
QByteArray getPropTrackerListState() const; QByteArray getPropTrackerListState() const;
void setPropTrackerListState(const QByteArray &state); void setPropTrackerListState(const QByteArray &state);
QByteArray getRssGeometry() const; QByteArray getRssGeometry() const;
void setRssGeometry(const QByteArray &geometry); void setRssGeometry(const QByteArray &geometry);
QByteArray getRssHSplitterSizes() const; QByteArray getRssHSplitterSizes() const;
void setRssHSplitterSizes(const QByteArray &sizes); void setRssHSplitterSizes(const QByteArray &sizes);
QStringList getRssOpenFolders() const; QStringList getRssOpenFolders() const;
void setRssOpenFolders(const QStringList &folders); void setRssOpenFolders(const QStringList &folders);
QByteArray getRssHSplitterState() const; QByteArray getRssHSplitterState() const;
void setRssHSplitterState(const QByteArray &state); void setRssHSplitterState(const QByteArray &state);
QByteArray getRssVSplitterState() const; QByteArray getRssVSplitterState() const;
void setRssVSplitterState(const QByteArray &state); void setRssVSplitterState(const QByteArray &state);
QString getSearchColsWidth() const; QString getSearchColsWidth() const;
void setSearchColsWidth(const QString &width); void setSearchColsWidth(const QString &width);
QStringList getSearchEngDisabled() const; QStringList getSearchEngDisabled() const;
void setSearchEngDisabled(const QStringList &engines); void setSearchEngDisabled(const QStringList &engines);
QString getCreateTorLastAddPath() const; QString getCreateTorLastAddPath() const;
void setCreateTorLastAddPath(const QString &path); void setCreateTorLastAddPath(const QString &path);
QString getCreateTorLastSavePath() const; QString getCreateTorLastSavePath() const;
void setCreateTorLastSavePath(const QString &path); void setCreateTorLastSavePath(const QString &path);
QString getCreateTorTrackers() const; QString getCreateTorTrackers() const;
void setCreateTorTrackers(const QString &path); void setCreateTorTrackers(const QString &path);
QByteArray getCreateTorGeometry() const; QByteArray getCreateTorGeometry() const;
void setCreateTorGeometry(const QByteArray &geometry); void setCreateTorGeometry(const QByteArray &geometry);
bool getCreateTorIgnoreRatio() const; bool getCreateTorIgnoreRatio() const;
void setCreateTorIgnoreRatio(const bool ignore); void setCreateTorIgnoreRatio(const bool ignore);
QString getTorImportLastContentDir() const; QString getTorImportLastContentDir() const;
void setTorImportLastContentDir(const QString &path); void setTorImportLastContentDir(const QString &path);
QByteArray getTorImportGeometry() const; QByteArray getTorImportGeometry() const;
void setTorImportGeometry(const QByteArray &geometry); void setTorImportGeometry(const QByteArray &geometry);
int getTransSelFilter() const; int getTransSelFilter() const;
void setTransSelFilter(const int &index); void setTransSelFilter(const int &index);
QByteArray getTransHeaderState() const; QByteArray getTransHeaderState() const;
void setTransHeaderState(const QByteArray &state); void setTransHeaderState(const QByteArray &state);
int getToolbarTextPosition() const; int getToolbarTextPosition() const;
void setToolbarTextPosition(const int position); void setToolbarTextPosition(const int position);
// Temp code. // Temp code.
// See TorrentStatistics::loadStats() for details. // See TorrentStatistics::loadStats() for details.
QVariantHash getStats() const; QVariantHash getStats() const;
void removeStats(); void removeStats();
//From old RssSettings class //From old RssSettings class
bool isRSSEnabled() const; bool isRSSEnabled() const;
void setRSSEnabled(const bool enabled); void setRSSEnabled(const bool enabled);
uint getRSSRefreshInterval() const; uint getRSSRefreshInterval() const;
void setRSSRefreshInterval(const uint &interval); void setRSSRefreshInterval(const uint &interval);
int getRSSMaxArticlesPerFeed() const; int getRSSMaxArticlesPerFeed() const;
void setRSSMaxArticlesPerFeed(const int &nb); void setRSSMaxArticlesPerFeed(const int &nb);
bool isRssDownloadingEnabled() const; bool isRssDownloadingEnabled() const;
void setRssDownloadingEnabled(const bool b); void setRssDownloadingEnabled(const bool b);
QStringList getRssFeedsUrls() const; QStringList getRssFeedsUrls() const;
void setRssFeedsUrls(const QStringList &rssFeeds); void setRssFeedsUrls(const QStringList &rssFeeds);
QStringList getRssFeedsAliases() const; QStringList getRssFeedsAliases() const;
void setRssFeedsAliases(const QStringList &rssAliases); void setRssFeedsAliases(const QStringList &rssAliases);
QList<QByteArray> getHostNameCookies(const QString &host_name) const; QList<QByteArray> getHostNameCookies(const QString &host_name) const;
QList<QNetworkCookie> getHostNameQNetworkCookies(const QString& host_name) const; QList<QNetworkCookie> getHostNameQNetworkCookies(const QString& host_name) const;
void setHostNameCookies(const QString &host_name, const QList<QByteArray> &cookies); void setHostNameCookies(const QString &host_name, const QList<QByteArray> &cookies);
}; };
#endif // PREFERENCES_H #endif // PREFERENCES_H