From 0fda919268638dd18eac0687ef78120fcabd8f9f Mon Sep 17 00:00:00 2001 From: Thomas Piccirello Date: Thu, 8 Mar 2018 01:10:53 -0500 Subject: [PATCH] Instantiate SearchPluginManager with other application components --- src/app/application.cpp | 3 +++ src/gui/search/searchwidget.cpp | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/application.cpp b/src/app/application.cpp index de322790d..6d4b0a023 100644 --- a/src/app/application.cpp +++ b/src/app/application.cpp @@ -72,6 +72,7 @@ #include "base/rss/rss_autodownloader.h" #include "base/rss/rss_session.h" #include "base/scanfoldersmodel.h" +#include "base/search/searchpluginmanager.h" #include "base/settingsstorage.h" #include "base/utils/fs.h" #include "base/utils/misc.h" @@ -514,6 +515,7 @@ int Application::exec(const QStringList ¶ms) new RSS::Session; // create RSS::Session singleton new RSS::AutoDownloader; // create RSS::AutoDownloader singleton + new SearchPluginManager; #ifdef DISABLE_GUI #ifndef DISABLE_WEBUI @@ -708,6 +710,7 @@ void Application::cleanup() delete m_webui; #endif + delete SearchPluginManager::instance(); delete RSS::AutoDownloader::instance(); delete RSS::Session::instance(); diff --git a/src/gui/search/searchwidget.cpp b/src/gui/search/searchwidget.cpp index d4e3fba9f..e3295cd1e 100644 --- a/src/gui/search/searchwidget.cpp +++ b/src/gui/search/searchwidget.cpp @@ -133,8 +133,7 @@ SearchWidget::SearchWidget(MainWindow *mainWindow) connect(m_tabStatusChangedMapper, static_cast(&QSignalMapper::mapped) , this, &SearchWidget::tabStatusChanged); - // NOTE: Although SearchManager is Application-wide component now, we still create it the legacy way. - auto *searchManager = new SearchPluginManager; + auto *searchManager = SearchPluginManager::instance(); const auto onPluginChanged = [this]() { fillPluginComboBox();