forked from qt-creator/qt-creator
Locator: Guard settings saving against filters with empty ID
When constructing the settings key, an empty ID would lead to writing
(in this case removing) the whole Locator settings category, which
overwrites all indidvidual Locator settings. Don't save settings for
filters with empty ID at all.
Introduced when introducing clangd support to ClangCodeModel plugin.
Amends ecafdb7543
Fixes: QTCREATORBUG-26101
Change-Id: I4ecb4f86fa8a0ef2bc2417206629c9e322addb12
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -318,7 +318,7 @@ void Locator::saveSettings() const
|
||||
s->remove(QString());
|
||||
s->setValue("RefreshInterval", refreshInterval());
|
||||
for (ILocatorFilter *filter : m_filters) {
|
||||
if (!m_customFilters.contains(filter)) {
|
||||
if (!m_customFilters.contains(filter) && filter->id().isValid()) {
|
||||
const QByteArray state = filter->saveState();
|
||||
s->setValueWithDefault(filter->id().toString(), state);
|
||||
}
|
||||
|
Reference in New Issue
Block a user