diff --git a/scriptengines/javascript/dataengine/javascriptdataengine.cpp b/scriptengines/javascript/dataengine/javascriptdataengine.cpp index 537a434f6..63a393739 100644 --- a/scriptengines/javascript/dataengine/javascriptdataengine.cpp +++ b/scriptengines/javascript/dataengine/javascriptdataengine.cpp @@ -312,18 +312,9 @@ Plasma::Service *JavaScriptDataEngine::serviceForSource(const QString &source) QString JavaScriptDataEngine::filePath(const char *type, const QString &file) const { - QScriptContext *c = m_qscriptEngine->currentContext(); - while (c) { - QScriptValue v = c->activationObject().property("__plasma_package"); - //kDebug() << "variant in parent context?" << v.isVariant(); - if (v.isVariant()) { - const QString path = v.toVariant().value().filePath(type, file); - if (!path.isEmpty()) { - return path; - } - } - - c = c->parentContext(); + const QString path = m_env->filePathFromScriptContext(type, file); + if (path.isEmpty()) { + return path; } return package()->filePath(type, file);