locations runner: Fix empty list on invalid shell quotes

wilder-5.22
Alexander Lohnau 5 years ago
parent ec751bf1b3
commit 8b6ad495d0
  1. 9
      runners/locations/locationrunner.cpp

@ -53,9 +53,12 @@ void LocationsRunner::match(Plasma::RunnerContext &context)
{
QString term = context.query();
// If we have a query with an executable and optionally arguments, BUG: 433053
QFileInfo tmpInfo(KShell::tildeExpand(KShell::splitArgs(term).constFirst()));
if (tmpInfo.isFile() && tmpInfo.isExecutable()) {
return;
const QStringList split = KShell::splitArgs(term);
if (!split.isEmpty()) {
QFileInfo tmpInfo(KShell::tildeExpand(split.constFirst()));
if (tmpInfo.isFile() && tmpInfo.isExecutable()) {
return;
}
}
// We want to expand ENV variables like $HOME to get the actual path, BUG: 358221
KUriFilter::self()->filterUri(term, {QStringLiteral("kshorturifilter")});

Loading…
Cancel
Save