summaryrefslogtreecommitdiffstats
path: root/src/assistant
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2019-02-19 10:23:09 +0100
committerJarek Kobus <jaroslaw.kobus@qt.io>2019-03-01 10:11:55 +0000
commit0198964f88c938f07058fe6deefaaa79434dc002 (patch)
tree116c725f9532aa1c86c41169eaf766e3bdefe0c4 /src/assistant
parentd0ac28e41b53f69a7d9fe89994a04fcb436c6e99 (diff)
Fix handling of current filter rename and removal
After renaming the current filter in preferences and applying changes, rename the current filter properly in the help engine. Change-Id: I5a70171b494b50b30f1d95a8cce05acd0f5c3b8d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/assistant')
-rw-r--r--src/assistant/assistant/preferencesdialog.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/assistant/assistant/preferencesdialog.cpp b/src/assistant/assistant/preferencesdialog.cpp
index 967dfba32..8d587eac2 100644
--- a/src/assistant/assistant/preferencesdialog.cpp
+++ b/src/assistant/assistant/preferencesdialog.cpp
@@ -335,6 +335,9 @@ void PreferencesDialog::renameFilterClicked()
const QHelpFilterData oldFilterData = m_currentSetup.m_filterToData.value(currentFilter);
removeFilter(currentFilter);
addFilter(newFilterName, oldFilterData);
+
+ if (m_currentSetup.m_currentFilter == currentFilter)
+ m_currentSetup.m_currentFilter = newFilterName;
}
void PreferencesDialog::removeFilterClicked()
@@ -352,6 +355,9 @@ void PreferencesDialog::removeFilterClicked()
}
removeFilter(currentFilter);
+
+ if (m_currentSetup.m_currentFilter == currentFilter)
+ m_currentSetup.m_currentFilter.clear();
}
void PreferencesDialog::addFilter(const QString &filterName,
@@ -524,10 +530,13 @@ void PreferencesDialog::applyChanges()
changed = true;
}
- // in order to update the filtercombobox and indexwidget
- // according to the new filter configuration
- if (changed)
+ if (changed) {
+ helpEngine.filterEngine()->setActiveFilter(m_currentSetup.m_currentFilter);
+
+ // In order to update the filtercombobox and indexwidget
+ // according to the new filter configuration.
helpEngine.setupData();
+ }
helpEngine.setShowTabs(m_ui.showTabs->isChecked());
if (m_showTabs != m_ui.showTabs->isChecked())