Browse Source

- Category combobox is now updated when search engines are enabled/disabled

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
8d39e2a776
  1. 3
      src/searchEngine.cpp
  2. 12
      src/supportedEngines.h

3
src/searchEngine.cpp

@ -173,7 +173,8 @@ void SearchEngine::tab_changed(int t)
} }
void SearchEngine::on_enginesButton_clicked() { 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 // get the last searchs from a QSettings to a QStringList

12
src/supportedEngines.h

@ -123,11 +123,13 @@ public:
QStringList supportedCategories() const { QStringList supportedCategories() const {
QStringList supported_cat; QStringList supported_cat;
foreach(SupportedEngine *engine, values()) { foreach(SupportedEngine *engine, values()) {
QStringList s = engine->getSupportedCategories(); if(engine->isEnabled()) {
foreach(QString cat, s) { QStringList s = engine->getSupportedCategories();
cat = cat.trimmed(); foreach(QString cat, s) {
if(!cat.isEmpty() && !supported_cat.contains(cat)) cat = cat.trimmed();
supported_cat << cat; if(!cat.isEmpty() && !supported_cat.contains(cat))
supported_cat << cat;
}
} }
} }
return supported_cat; return supported_cat;

Loading…
Cancel
Save