summaryrefslogtreecommitdiffstats
path: root/tools/assistant/tools/assistant/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/assistant/tools/assistant/mainwindow.cpp')
-rw-r--r--tools/assistant/tools/assistant/mainwindow.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp
index de3f695659..c56e7e435b 100644
--- a/tools/assistant/tools/assistant/mainwindow.cpp
+++ b/tools/assistant/tools/assistant/mainwindow.cpp
@@ -227,16 +227,8 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent)
if (!m_cmdLine->currentFilter().isEmpty()) {
const QString &curFilter = m_cmdLine->currentFilter();
- m_helpEngine->setCurrentFilter(curFilter);
- if (m_filterCombo) {
- int idx = m_filterCombo->findText(curFilter);
- if (idx >= 0) {
- bool blocked = m_filterCombo->signalsBlocked();
- m_filterCombo->blockSignals(true);
- m_filterCombo->setCurrentIndex(idx);
- m_filterCombo->blockSignals(blocked);
- }
- }
+ if (m_helpEngine->customFilters().contains(curFilter))
+ m_helpEngine->setCurrentFilter(curFilter);
}
if (usesDefaultCollection())
@@ -664,6 +656,8 @@ void MainWindow::setupFilterToolbar()
SLOT(setupFilterCombo()));
connect(m_filterCombo, SIGNAL(activated(QString)), this,
SLOT(filterDocumentation(QString)));
+ connect(m_helpEngine, SIGNAL(currentFilterChanged(QString)), this,
+ SLOT(currentFilterChanged(QString)));
setupFilterCombo();
}
@@ -1041,4 +1035,11 @@ QString MainWindow::defaultHelpCollectionFileName()
arg(QLatin1String(QT_VERSION_STR));
}
+void MainWindow::currentFilterChanged(const QString &filter)
+{
+ const int index = m_filterCombo->findText(filter);
+ Q_ASSERT(index != -1);
+ m_filterCombo->setCurrentIndex(index);
+}
+
QT_END_NAMESPACE