From 0c6ed54a5207744b5ee4da1e91d829ee3a2fdeb7 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Sat, 4 Sep 2010 22:51:32 +0000 Subject: [PATCH] use filePathFromScriptContext svn path=/trunk/KDE/kdebase/runtime/; revision=1171721 --- .../dataengine/javascriptdataengine.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) 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);