qBittorrent
|
#include <torrentfileswatcher.h>
Classes | |
struct | WatchedFolderOptions |
class | Worker |
Signals | |
void | watchedFolderSet (const QString &path, const WatchedFolderOptions &options) |
void | watchedFolderRemoved (const QString &path) |
Public Member Functions | |
QHash< QString, WatchedFolderOptions > | folders () const |
void | setWatchedFolder (const QString &path, const WatchedFolderOptions &options) |
void | removeWatchedFolder (const QString &path) |
Static Public Member Functions | |
static void | initInstance () |
static void | freeInstance () |
static TorrentFilesWatcher * | instance () |
static QString | makeCleanPath (const QString &path) |
Private Slots | |
void | onMagnetFound (const BitTorrent::MagnetUri &magnetURI, const BitTorrent::AddTorrentParams &addTorrentParams) |
void | onTorrentFound (const BitTorrent::TorrentInfo &torrentInfo, const BitTorrent::AddTorrentParams &addTorrentParams) |
Private Member Functions | |
TorrentFilesWatcher (QObject *parent=nullptr) | |
~TorrentFilesWatcher () override | |
void | load () |
void | loadLegacy () |
void | store () const |
void | doSetWatchedFolder (const QString &path, const WatchedFolderOptions &options) |
Private Attributes | |
QHash< QString, WatchedFolderOptions > | m_watchedFolders |
QThread * | m_ioThread = nullptr |
Worker * | m_asyncWorker = nullptr |
Static Private Attributes | |
static TorrentFilesWatcher * | m_instance = nullptr |
Definition at line 48 of file torrentfileswatcher.h.
|
explicitprivate |
Definition at line 256 of file torrentfileswatcher.cpp.
References load(), m_asyncWorker, m_ioThread, TorrentFilesWatcher::Worker::magnetFound(), onMagnetFound(), onTorrentFound(), and TorrentFilesWatcher::Worker::torrentFound().
|
overrideprivate |
Definition at line 270 of file torrentfileswatcher.cpp.
References m_asyncWorker, and m_ioThread.
|
private |
Definition at line 404 of file torrentfileswatcher.cpp.
References m_asyncWorker, m_watchedFolders, makeCleanPath(), TorrentFilesWatcher::Worker::setWatchedFolder(), and watchedFolderSet().
Referenced by load(), loadLegacy(), and setWatchedFolder().
QHash< QString, TorrentFilesWatcher::WatchedFolderOptions > TorrentFilesWatcher::folders | ( | ) | const |
Definition at line 393 of file torrentfileswatcher.cpp.
References m_watchedFolders.
Referenced by AppController::preferencesAction(), and AppController::setPreferencesAction().
|
static |
Definition at line 245 of file torrentfileswatcher.cpp.
Referenced by Application::cleanup().
|
static |
Definition at line 239 of file torrentfileswatcher.cpp.
Referenced by Application::exec().
|
static |
Definition at line 251 of file torrentfileswatcher.cpp.
Referenced by OptionsDialog::OptionsDialog(), AppController::preferencesAction(), and AppController::setPreferencesAction().
|
private |
Definition at line 288 of file torrentfileswatcher.cpp.
References CONF_FILE_NAME, Config, doSetWatchedFolder(), loadLegacy(), LogMsg(), Exception::message(), anonymous_namespace{torrentfileswatcher.cpp}::parseWatchedFolderOptions(), specialFolderLocation(), and Log::WARNING.
Referenced by TorrentFilesWatcher().
|
private |
Definition at line 336 of file torrentfileswatcher.cpp.
References doSetWatchedFolder(), SettingsStorage::instance(), SettingsStorage::loadValue(), LogMsg(), Exception::message(), SettingsStorage::removeValue(), BitTorrent::AddTorrentParams::savePath, store(), BitTorrent::AddTorrentParams::useAutoTMM, and Log::WARNING.
Referenced by load().
|
static |
Definition at line 277 of file torrentfileswatcher.cpp.
Referenced by WatchedFoldersModel::addFolder(), doSetWatchedFolder(), removeWatchedFolder(), and AppController::setPreferencesAction().
|
privateslot |
Definition at line 433 of file torrentfileswatcher.cpp.
References BitTorrent::Session::addTorrent(), and BitTorrent::Session::instance().
Referenced by TorrentFilesWatcher().
|
privateslot |
Definition at line 439 of file torrentfileswatcher.cpp.
References BitTorrent::Session::addTorrent(), and BitTorrent::Session::instance().
Referenced by TorrentFilesWatcher().
void TorrentFilesWatcher::removeWatchedFolder | ( | const QString & | path | ) |
Definition at line 417 of file torrentfileswatcher.cpp.
References m_asyncWorker, m_watchedFolders, makeCleanPath(), TorrentFilesWatcher::Worker::removeWatchedFolder(), store(), and watchedFolderRemoved().
Referenced by WatchedFoldersModel::apply(), and AppController::setPreferencesAction().
void TorrentFilesWatcher::setWatchedFolder | ( | const QString & | path, |
const WatchedFolderOptions & | options | ||
) |
Definition at line 398 of file torrentfileswatcher.cpp.
References doSetWatchedFolder(), and store().
Referenced by WatchedFoldersModel::apply(), and AppController::setPreferencesAction().
|
private |
Definition at line 373 of file torrentfileswatcher.cpp.
References CONF_FILE_NAME, Config, LogMsg(), m_watchedFolders, Utils::IO::saveToFile(), anonymous_namespace{torrentfileswatcher.cpp}::serializeWatchedFolderOptions(), specialFolderLocation(), and Log::WARNING.
Referenced by loadLegacy(), removeWatchedFolder(), and setWatchedFolder().
|
signal |
Referenced by removeWatchedFolder(), and WatchedFoldersModel::WatchedFoldersModel().
|
signal |
Referenced by doSetWatchedFolder(), and WatchedFoldersModel::WatchedFoldersModel().
|
private |
Definition at line 95 of file torrentfileswatcher.h.
Referenced by doSetWatchedFolder(), removeWatchedFolder(), TorrentFilesWatcher(), and ~TorrentFilesWatcher().
|
staticprivate |
Definition at line 88 of file torrentfileswatcher.h.
|
private |
Definition at line 92 of file torrentfileswatcher.h.
Referenced by TorrentFilesWatcher(), and ~TorrentFilesWatcher().
|
private |
Definition at line 90 of file torrentfileswatcher.h.
Referenced by TorrentFilesWatcher::Worker::addWatchedFolder(), doSetWatchedFolder(), folders(), TorrentFilesWatcher::Worker::processFailedTorrents(), TorrentFilesWatcher::Worker::processFolder(), TorrentFilesWatcher::Worker::processWatchedFolder(), TorrentFilesWatcher::Worker::removeWatchedFolder(), removeWatchedFolder(), TorrentFilesWatcher::Worker::setWatchedFolder(), store(), and TorrentFilesWatcher::Worker::updateWatchedFolder().