Commit 518426c4 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

[kicker/kickoff] Fix urls for search results

Having the right url is needed for drag and drop to work

For the recentdocuments runner  we can just take the result

For the services runner the result is of the form "applications:org.kde.foo.desktop", so extract the service name from that

BUG: 456984
parent cc351474
Pipeline #209211 passed with stage
in 11 minutes and 10 seconds
......@@ -56,12 +56,16 @@ QVariant RunnerMatchesModel::data(const QModelIndex &index, int role) const
}
} else if (role == Kicker::UrlRole) {
const QString &runnerId = match.runner()->id();
if (runnerId == QLatin1String("baloosearch") || runnerId == QLatin1String("bookmarks")) {
if (runnerId == QLatin1String("baloosearch") || runnerId == QLatin1String("bookmarks") || runnerId == QLatin1String("recentdocuments")) {
return QUrl(match.data().toString());
} else if (runnerId == QLatin1String("recentdocuments") || runnerId == QLatin1String("services")) {
KService::Ptr service = KService::serviceByStorageId(match.data().toString());
if (service) {
return QUrl::fromLocalFile(Kicker::resolvedServiceEntryPath(service));
} else if (runnerId == QLatin1String("services")) {
const QString result = match.data().toString();
if (result.startsWith(QLatin1String("applications:"))) {
KService::Ptr service = KService::serviceByStorageId(result.mid(13));
if (service) {
return QUrl::fromLocalFile(Kicker::resolvedServiceEntryPath(service));
}
}
}
} else if (role == Kicker::HasActionListRole) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment