Commit c1767716 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

TextEditor: Correctly restore empty pattern



Only default to first entry when the pattern was never set.

Change-Id: I4d2a76218347adb4aa28ef3e8fd0e81485faf184
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent d7b648ab
...@@ -285,10 +285,11 @@ void BaseFileFind::writeCommonSettings(QSettings *settings) ...@@ -285,10 +285,11 @@ void BaseFileFind::writeCommonSettings(QSettings *settings)
void BaseFileFind::readCommonSettings(QSettings *settings, const QString &defaultFilter) void BaseFileFind::readCommonSettings(QSettings *settings, const QString &defaultFilter)
{ {
QStringList filters = settings->value(QLatin1String("filters")).toStringList(); QStringList filters = settings->value(QLatin1String("filters")).toStringList();
d->m_filterSetting = settings->value(QLatin1String("currentFilter")).toString(); const QVariant currentFilter = settings->value(QLatin1String("currentFilter"));
d->m_filterSetting = currentFilter.toString();
if (filters.isEmpty()) if (filters.isEmpty())
filters << defaultFilter; filters << defaultFilter;
if (d->m_filterSetting.isEmpty()) if (!currentFilter.isValid())
d->m_filterSetting = filters.first(); d->m_filterSetting = filters.first();
d->m_filterStrings.setStringList(filters); d->m_filterStrings.setStringList(filters);
if (d->m_filterCombo) if (d->m_filterCombo)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment