check for the app on disk first before going through the sycoca entries

svn path=/trunk/KDE/kdebase/runtime/; revision=1097624
This commit is contained in:
Aaron J. Seigo 2010-03-01 19:24:42 +00:00
parent 1bd327f133
commit a70f54e0d3

View File

@ -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;
}