diff --git a/applets/kicker/plugin/recentusagemodel.cpp b/applets/kicker/plugin/recentusagemodel.cpp --- a/applets/kicker/plugin/recentusagemodel.cpp +++ b/applets/kicker/plugin/recentusagemodel.cpp @@ -26,14 +26,17 @@ #include #include +#include #include +#include #if HAVE_X11 #include #endif #include #include #include +#include #include #include #include @@ -280,7 +283,20 @@ const QString &resource = resourceAt(row); if (!resource.startsWith(QLatin1String("applications:"))) { - new KRun(docData(resource, Kicker::UrlRole).toUrl(), 0); + const QUrl resourceUrl = docData(resource, Kicker::UrlRole).toUrl(); + const QList urlsList{resourceUrl}; + + QMimeDatabase db; + QMimeType mime = db.mimeTypeForUrl(resourceUrl); + KService::Ptr service = KMimeTypeTrader::self()->preferredService(mime.name()); + if (service) { + KRun::runApplication(*service, urlsList, nullptr); + } else { + QTimer::singleShot(0, [urlsList] { + KRun::displayOpenWithDialog(urlsList, nullptr); + }); + } + return true; }