From 8e80b5de54606be94ccd358251f5f0962dae1e7b Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Wed, 19 Aug 2020 20:42:58 +0200 Subject: [PATCH] improve search behavior in edge cases --- pass.cpp | 4 ++-- pass.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pass.cpp b/pass.cpp index a4cf786..da6adb9 100644 --- a/pass.cpp +++ b/pass.cpp @@ -159,8 +159,8 @@ void Pass::match(Plasma::RunnerContext &context) auto input = context.query(); // If we use the prefix we want to remove it - if (input.startsWith(queryPrefix)) { - input = input.remove(queryPrefix).simplified(); + if (input.contains(queryPrefix)) { + input = input.remove(QLatin1String("pass")).simplified(); } else if (input.count() < 3 && !context.singleRunnerQueryMode()) { return; } diff --git a/pass.h b/pass.h index a12c737..1218b87 100644 --- a/pass.h +++ b/pass.h @@ -23,6 +23,7 @@ #include #include #include +#include class Pass : public Plasma::AbstractRunner { @@ -58,7 +59,7 @@ private: bool showActions; QList orderedActions; - const QLatin1String queryPrefix = QLatin1String("pass"); + const QRegularExpression queryPrefix = QRegularExpression("^pass( .+)?$"); }; #endif