Locator: Don't ask disabled filters for results

If they are disabled, behave is if they didn't exist (when looking for
matches). This was no issue with our own filters so far, because these
(by accident) also don't have anything to return if they are disabled.

Change-Id: Ia5fe85039631c41f7488d78d9f54b6322dc72b32
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Eike Ziller
2017-08-31 14:05:28 +02:00
parent be4cfb5f16
commit 285f054d74

View File

@@ -746,7 +746,8 @@ QList<ILocatorFilter *> LocatorWidget::filtersFor(const QString &text, QString &
break; break;
} }
const int whiteSpace = text.indexOf(QChar::Space, firstNonSpace); const int whiteSpace = text.indexOf(QChar::Space, firstNonSpace);
const QList<ILocatorFilter *> filters = Locator::filters(); const QList<ILocatorFilter *> filters = Utils::filtered(Locator::filters(),
&ILocatorFilter::isEnabled);
if (whiteSpace >= 0) { if (whiteSpace >= 0) {
const QString prefix = text.mid(firstNonSpace, whiteSpace - firstNonSpace).toLower(); const QString prefix = text.mid(firstNonSpace, whiteSpace - firstNonSpace).toLower();
QList<ILocatorFilter *> prefixFilters; QList<ILocatorFilter *> prefixFilters;