From 6396bcd1243bcfa40ffad9f1cd2cc7c32c2bbe1d Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 10 Oct 2016 01:33:27 +0100 Subject: [PATCH] No-op SeachRunner if indexing is disabled Summary: We won't have any results anyway. Test Plan: Disabled indexing and put a qDebug in the if branch I'm not super convinced it's a good idea myself. It means parsing a config file every match and it can't be cached without missing updates if the user enables/disables at runtime. Reviewers: #plasma Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D2995 --- runners/baloo/baloosearchrunner.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runners/baloo/baloosearchrunner.cpp b/runners/baloo/baloosearchrunner.cpp index c0bf9d377..f8f92e235 100644 --- a/runners/baloo/baloosearchrunner.cpp +++ b/runners/baloo/baloosearchrunner.cpp @@ -31,6 +31,7 @@ #include #include +#include #include @@ -86,6 +87,11 @@ QIcon SearchRunner::categoryIcon(const QString& category) const QList SearchRunner::match(Plasma::RunnerContext& context, const QString& type, const QString& category) { + Baloo::IndexerConfig config; + if (!config.fileIndexingEnabled()) { + return QList(); + } + if (!context.isValid()) return QList();