qBittorrent
|
#include <searchpluginmanager.h>
Signals | |
void | pluginEnabled (const QString &name, bool enabled) |
void | pluginInstalled (const QString &name) |
void | pluginInstallationFailed (const QString &name, const QString &reason) |
void | pluginUninstalled (const QString &name) |
void | pluginUpdated (const QString &name) |
void | pluginUpdateFailed (const QString &name, const QString &reason) |
void | checkForUpdatesFinished (const QHash< QString, PluginVersion > &updateInfo) |
void | checkForUpdatesFailed (const QString &reason) |
Public Member Functions | |
SearchPluginManager () | |
~SearchPluginManager () override | |
QStringList | allPlugins () const |
QStringList | enabledPlugins () const |
QStringList | supportedCategories () const |
QStringList | getPluginCategories (const QString &pluginName) const |
PluginInfo * | pluginInfo (const QString &name) const |
void | enablePlugin (const QString &name, bool enabled=true) |
void | updatePlugin (const QString &name) |
void | installPlugin (const QString &source) |
bool | uninstallPlugin (const QString &name) |
void | checkForUpdates () |
SearchHandler * | startSearch (const QString &pattern, const QString &category, const QStringList &usedPlugins) |
SearchDownloadHandler * | downloadTorrent (const QString &siteUrl, const QString &url) |
QString | pluginFullName (const QString &pluginName) |
Static Public Member Functions | |
static SearchPluginManager * | instance () |
static void | freeInstance () |
static void | updateIconPath (PluginInfo *const plugin) |
static PluginVersion | getPluginVersion (const QString &filePath) |
static QString | categoryFullName (const QString &categoryName) |
static QString | pluginsLocation () |
static QString | engineLocation () |
Private Member Functions | |
void | update () |
void | updateNova () |
void | parseVersionInfo (const QByteArray &info) |
void | installPlugin_impl (const QString &name, const QString &path) |
bool | isUpdateNeeded (const QString &pluginName, PluginVersion newVersion) const |
void | versionInfoDownloadFinished (const Net::DownloadResult &result) |
void | pluginDownloadFinished (const Net::DownloadResult &result) |
Static Private Member Functions | |
static QString | pluginPath (const QString &name) |
Private Attributes | |
const QString | m_updateUrl |
QHash< QString, PluginInfo * > | m_plugins |
Static Private Attributes | |
static QPointer< SearchPluginManager > | m_instance = nullptr |
Definition at line 60 of file searchpluginmanager.h.
SearchPluginManager::SearchPluginManager | ( | ) |
Definition at line 86 of file searchpluginmanager.cpp.
References m_instance, update(), and updateNova().
Referenced by instance().
|
override |
Definition at line 96 of file searchpluginmanager.cpp.
References m_plugins.
QStringList SearchPluginManager::allPlugins | ( | ) | const |
Definition at line 113 of file searchpluginmanager.cpp.
References m_plugins.
Referenced by getPluginCategories(), PluginSelectDialog::loadSupportedSearchPlugins(), SearchWidget::on_searchButton_clicked(), SearchController::pluginsAction(), and SearchController::startAction().
|
static |
Definition at line 338 of file searchpluginmanager.cpp.
Referenced by SearchWidget::fillCatCombobox(), and anonymous_namespace{searchcontroller.cpp}::getPluginCategories().
void SearchPluginManager::checkForUpdates | ( | ) |
Definition at line 317 of file searchpluginmanager.cpp.
References m_updateUrl, and versionInfoDownloadFinished().
Referenced by PluginSelectDialog::on_updateButton_clicked(), and SearchController::updatePluginsAction().
|
signal |
Referenced by parseVersionInfo(), PluginSelectDialog::PluginSelectDialog(), SearchController::updatePluginsAction(), and versionInfoDownloadFinished().
|
signal |
Referenced by parseVersionInfo(), PluginSelectDialog::PluginSelectDialog(), and SearchController::updatePluginsAction().
SearchDownloadHandler * SearchPluginManager::downloadTorrent | ( | const QString & | siteUrl, |
const QString & | url | ||
) |
Definition at line 325 of file searchpluginmanager.cpp.
Referenced by SearchJobWidget::downloadTorrent().
QStringList SearchPluginManager::enabledPlugins | ( | ) | const |
Definition at line 118 of file searchpluginmanager.cpp.
References asConst(), and m_plugins.
Referenced by getPluginCategories(), SearchWidget::on_searchButton_clicked(), and SearchController::startAction().
void SearchPluginManager::enablePlugin | ( | const QString & | name, |
bool | enabled = true |
||
) |
Definition at line 175 of file searchpluginmanager.cpp.
References PluginInfo::enabled, Preferences::getSearchEngDisabled(), Preferences::instance(), m_plugins, pluginEnabled(), and Preferences::setSearchEngDisabled().
Referenced by SearchController::enablePluginAction(), PluginSelectDialog::enableSelection(), PluginSelectDialog::on_actionUninstall_triggered(), and PluginSelectDialog::togglePluginState().
|
static |
Definition at line 365 of file searchpluginmanager.cpp.
References Data, Utils::Fs::expandPathAbs(), and specialFolderLocation().
Referenced by installPlugin(), pluginsLocation(), SearchDownloadHandler::SearchDownloadHandler(), SearchHandler::SearchHandler(), uninstallPlugin(), update(), and updateNova().
|
static |
Definition at line 108 of file searchpluginmanager.cpp.
References m_instance.
Referenced by Application::cleanup().
QStringList SearchPluginManager::getPluginCategories | ( | const QString & | pluginName | ) | const |
Definition at line 148 of file searchpluginmanager.cpp.
References allPlugins(), asConst(), enabledPlugins(), pluginInfo(), and PluginInfo::supportedCategories.
|
static |
Definition at line 567 of file searchpluginmanager.cpp.
References Utils::Fs::fileName(), Utils::Version< T, N, Mandatory >::isValid(), LogMsg(), Utils::Version< unsigned short, 2 >::tryParse(), and Log::WARNING.
Referenced by installPlugin_impl(), update(), and updateNova().
void SearchPluginManager::installPlugin | ( | const QString & | source | ) |
Definition at line 201 of file searchpluginmanager.cpp.
References anonymous_namespace{searchpluginmanager.cpp}::clearPythonCache(), engineLocation(), Utils::Fs::fileName(), Net::DownloadManager::hasSupportedScheme(), installPlugin_impl(), pluginDownloadFinished(), pluginInstallationFailed(), Utils::IO::saveToFile(), and anonymous_namespace{misc.cpp}::source.
Referenced by PluginSelectDialog::askForLocalPlugin(), PluginSelectDialog::askForPluginUrl(), PluginSelectDialog::dropEvent(), SearchController::installPluginAction(), and updatePlugin().
|
private |
Definition at line 227 of file searchpluginmanager.cpp.
References copy, Utils::Fs::forceRemove(), getPluginVersion(), Log::INFO, LogMsg(), m_plugins, pluginInfo(), pluginInstallationFailed(), pluginPath(), pluginUpdateFailed(), update(), and PluginInfo::version.
Referenced by installPlugin(), and pluginDownloadFinished().
|
static |
Definition at line 101 of file searchpluginmanager.cpp.
References m_instance, and SearchPluginManager().
Referenced by SearchController::checkForUpdatesFinished(), SearchController::enablePluginAction(), SearchWidget::fillCatCombobox(), SearchWidget::fillPluginComboBox(), SearchController::getPluginsInfo(), SearchController::installPluginAction(), SearchWidget::on_pluginsButton_clicked(), SearchWidget::on_searchButton_clicked(), SearchController::pluginsAction(), SearchWidget::SearchWidget(), SearchWidget::selectActivePage(), SearchController::startAction(), SearchController::uninstallPluginAction(), and SearchController::updatePluginsAction().
|
private |
Definition at line 553 of file searchpluginmanager.cpp.
References pluginInfo(), and PluginInfo::version.
Referenced by parseVersionInfo().
|
private |
Definition at line 514 of file searchpluginmanager.cpp.
References checkForUpdatesFailed(), checkForUpdatesFinished(), Log::INFO, isUpdateNeeded(), Utils::Version< T, N, Mandatory >::isValid(), LogMsg(), Utils::ByteArray::splitToViews(), and Utils::Version< unsigned short, 2 >::tryParse().
Referenced by versionInfoDownloadFinished().
|
private |
Definition at line 387 of file searchpluginmanager.cpp.
References Net::DownloadResult::errorString, Utils::Fs::fileName(), Net::DownloadResult::filePath, Utils::Fs::forceRemove(), installPlugin_impl(), pluginInfo(), pluginInstallationFailed(), pluginUpdateFailed(), Net::DownloadResult::status, Net::Success, Utils::Fs::toUniformPath(), and Net::DownloadResult::url.
Referenced by installPlugin().
|
signal |
Referenced by enablePlugin(), and SearchWidget::SearchWidget().
QString SearchPluginManager::pluginFullName | ( | const QString & | pluginName | ) |
Definition at line 355 of file searchpluginmanager.cpp.
References PluginInfo::fullName, and pluginInfo().
PluginInfo * SearchPluginManager::pluginInfo | ( | const QString & | name | ) | const |
Definition at line 170 of file searchpluginmanager.cpp.
References m_plugins.
Referenced by PluginSelectDialog::addNewPlugin(), PluginSelectDialog::displayContextMenu(), getPluginCategories(), SearchController::getPluginsInfo(), PluginSelectDialog::iconDownloadFinished(), installPlugin_impl(), isUpdateNeeded(), pluginDownloadFinished(), pluginFullName(), PluginSelectDialog::pluginUpdated(), and PluginSelectDialog::togglePluginState().
|
signal |
Referenced by installPlugin(), installPlugin_impl(), pluginDownloadFinished(), and PluginSelectDialog::PluginSelectDialog().
|
signal |
Referenced by PluginSelectDialog::PluginSelectDialog(), SearchWidget::SearchWidget(), and update().
|
staticprivate |
Definition at line 562 of file searchpluginmanager.cpp.
References pluginsLocation().
Referenced by installPlugin_impl(), and update().
|
static |
Definition at line 360 of file searchpluginmanager.cpp.
References engineLocation().
Referenced by PluginSelectDialog::iconDownloadFinished(), pluginPath(), uninstallPlugin(), and updateIconPath().
|
signal |
Referenced by SearchWidget::SearchWidget(), and uninstallPlugin().
|
signal |
Referenced by PluginSelectDialog::PluginSelectDialog(), SearchWidget::SearchWidget(), and update().
|
signal |
Referenced by installPlugin_impl(), pluginDownloadFinished(), and PluginSelectDialog::PluginSelectDialog().
SearchHandler * SearchPluginManager::startSearch | ( | const QString & | pattern, |
const QString & | category, | ||
const QStringList & | usedPlugins | ||
) |
Definition at line 330 of file searchpluginmanager.cpp.
Referenced by SearchWidget::on_searchButton_clicked(), and SearchController::startAction().
QStringList SearchPluginManager::supportedCategories | ( | ) | const |
Definition at line 130 of file searchpluginmanager.cpp.
References asConst(), and m_plugins.
bool SearchPluginManager::uninstallPlugin | ( | const QString & | name | ) |
Definition at line 283 of file searchpluginmanager.cpp.
References anonymous_namespace{searchpluginmanager.cpp}::clearPythonCache(), engineLocation(), file(), files(), Utils::Fs::forceRemove(), m_plugins, pluginsLocation(), and pluginUninstalled().
Referenced by PluginSelectDialog::on_actionUninstall_triggered(), and SearchController::uninstallPluginAction().
|
private |
Definition at line 448 of file searchpluginmanager.cpp.
References engineLocation(), getPluginVersion(), Preferences::getSearchEngDisabled(), Preferences::instance(), m_plugins, pluginInstalled(), pluginPath(), pluginUpdated(), Utils::ForeignApps::pythonInfo(), Utils::Fs::toNativePath(), and updateIconPath().
Referenced by installPlugin_impl(), and SearchPluginManager().
|
static |
Definition at line 301 of file searchpluginmanager.cpp.
References PluginInfo::iconPath, PluginInfo::name, and pluginsLocation().
Referenced by PluginSelectDialog::iconDownloadFinished(), and update().
|
private |
Definition at line 412 of file searchpluginmanager.cpp.
References copy, engineLocation(), Utils::Fs::forceRemove(), and getPluginVersion().
Referenced by SearchPluginManager().
void SearchPluginManager::updatePlugin | ( | const QString & | name | ) |
Definition at line 195 of file searchpluginmanager.cpp.
References installPlugin(), and m_updateUrl.
Referenced by PluginSelectDialog::checkForUpdatesFinished(), and SearchController::checkForUpdatesFinished().
|
private |
Definition at line 379 of file searchpluginmanager.cpp.
References checkForUpdatesFailed(), Net::DownloadResult::data, Net::DownloadResult::errorString, parseVersionInfo(), Net::DownloadResult::status, and Net::Success.
Referenced by checkForUpdates().
|
staticprivate |
Definition at line 117 of file searchpluginmanager.h.
Referenced by freeInstance(), instance(), and SearchPluginManager().
|
private |
Definition at line 121 of file searchpluginmanager.h.
Referenced by allPlugins(), enabledPlugins(), enablePlugin(), installPlugin_impl(), pluginInfo(), supportedCategories(), uninstallPlugin(), update(), and ~SearchPluginManager().
|
private |
Definition at line 119 of file searchpluginmanager.h.
Referenced by checkForUpdates(), and updatePlugin().