diff --git a/scriptengines/javascript/scriptenv.cpp b/scriptengines/javascript/scriptenv.cpp index 4b15be567..a5a759e71 100644 --- a/scriptengines/javascript/scriptenv.cpp +++ b/scriptengines/javascript/scriptenv.cpp @@ -128,16 +128,16 @@ QScriptValue ScriptEnv::runApplication(QScriptContext *context, QScriptEngine *e const QString app = context->argument(0).toString(); - KService::Ptr service = KService::serviceByStorageId(app); - if (service) { - return KRun::run(*service, urls, 0); - } - const QString exec = KGlobal::dirs()->findExe(app); if (!exec.isEmpty()) { return KRun::run(exec, urls, 0); } + KService::Ptr service = KService::serviceByStorageId(app); + if (service) { + return KRun::run(*service, urls, 0); + } + return false; }