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
wilder-5.14
David Edmundson 10 years ago
parent d829e614eb
commit 6396bcd124
  1. 6
      runners/baloo/baloosearchrunner.cpp

@ -31,6 +31,7 @@
#include <QMimeData>
#include <Baloo/Query>
#include <Baloo/IndexerConfig>
#include <KIO/OpenFileManagerWindowJob>
@ -86,6 +87,11 @@ QIcon SearchRunner::categoryIcon(const QString& category) const
QList<Plasma::QueryMatch> SearchRunner::match(Plasma::RunnerContext& context, const QString& type,
const QString& category)
{
Baloo::IndexerConfig config;
if (!config.fileIndexingEnabled()) {
return QList<Plasma::QueryMatch>();
}
if (!context.isValid())
return QList<Plasma::QueryMatch>();

Loading…
Cancel
Save