diff --git a/src/base/search/searchpluginmanager.cpp b/src/base/search/searchpluginmanager.cpp index 89d08c98e..b1df35c92 100644 --- a/src/base/search/searchpluginmanager.cpp +++ b/src/base/search/searchpluginmanager.cpp @@ -62,18 +62,6 @@ namespace QPointer SearchPluginManager::m_instance = nullptr; -const QHash SearchPluginManager::m_categoryNames { - {"all", QT_TRANSLATE_NOOP("SearchEngine", "All categories")}, - {"movies", QT_TRANSLATE_NOOP("SearchEngine", "Movies")}, - {"tv", QT_TRANSLATE_NOOP("SearchEngine", "TV shows")}, - {"music", QT_TRANSLATE_NOOP("SearchEngine", "Music")}, - {"games", QT_TRANSLATE_NOOP("SearchEngine", "Games")}, - {"anime", QT_TRANSLATE_NOOP("SearchEngine", "Anime")}, - {"software", QT_TRANSLATE_NOOP("SearchEngine", "Software")}, - {"pictures", QT_TRANSLATE_NOOP("SearchEngine", "Pictures")}, - {"books", QT_TRANSLATE_NOOP("SearchEngine", "Books")} -}; - SearchPluginManager::SearchPluginManager() : m_updateUrl(QString("http://searchplugins.qbittorrent.org/%1/engines/").arg(Utils::Misc::pythonVersion() >= 3 ? "nova3" : "nova")) { @@ -307,7 +295,18 @@ SearchHandler *SearchPluginManager::startSearch(const QString &pattern, const QS QString SearchPluginManager::categoryFullName(const QString &categoryName) { - return tr(m_categoryNames.value(categoryName).toUtf8().constData()); + static const QHash categoryTable { + {"all", tr("All categories")}, + {"movies", tr("Movies")}, + {"tv", tr("TV shows")}, + {"music", tr("Music")}, + {"games", tr("Games")}, + {"anime", tr("Anime")}, + {"software", tr("Software")}, + {"pictures", tr("Pictures")}, + {"books", tr("Books")} + }; + return categoryTable.value(categoryName); } QString SearchPluginManager::pluginFullName(const QString &pluginName) diff --git a/src/base/search/searchpluginmanager.h b/src/base/search/searchpluginmanager.h index 536d012c7..89294af83 100644 --- a/src/base/search/searchpluginmanager.h +++ b/src/base/search/searchpluginmanager.h @@ -111,7 +111,6 @@ private: static QString pluginPath(const QString &name); static QPointer m_instance; - static const QHash m_categoryNames; const QString m_updateUrl;