From 8d39e2a77613ce4b60397853034d9abc71515d3f Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Tue, 25 Aug 2009 02:37:11 +0000 Subject: [PATCH] - Category combobox is now updated when search engines are enabled/disabled --- src/searchEngine.cpp | 3 ++- src/supportedEngines.h | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/searchEngine.cpp b/src/searchEngine.cpp index 4ab47f1a3..029b3404f 100644 --- a/src/searchEngine.cpp +++ b/src/searchEngine.cpp @@ -173,7 +173,8 @@ void SearchEngine::tab_changed(int t) } void SearchEngine::on_enginesButton_clicked() { - new engineSelectDlg(this, supported_engines); + engineSelectDlg *dlg = new engineSelectDlg(this, supported_engines); + connect(dlg, SIGNAL(enginesChanged()), this, SLOT(fillCatCombobox())); } // get the last searchs from a QSettings to a QStringList diff --git a/src/supportedEngines.h b/src/supportedEngines.h index e07283f90..1f3a51d71 100644 --- a/src/supportedEngines.h +++ b/src/supportedEngines.h @@ -123,11 +123,13 @@ public: QStringList supportedCategories() const { QStringList supported_cat; foreach(SupportedEngine *engine, values()) { - QStringList s = engine->getSupportedCategories(); - foreach(QString cat, s) { - cat = cat.trimmed(); - if(!cat.isEmpty() && !supported_cat.contains(cat)) - supported_cat << cat; + if(engine->isEnabled()) { + QStringList s = engine->getSupportedCategories(); + foreach(QString cat, s) { + cat = cat.trimmed(); + if(!cat.isEmpty() && !supported_cat.contains(cat)) + supported_cat << cat; + } } } return supported_cat;