use filePathFromScriptContext
svn path=/trunk/KDE/kdebase/runtime/; revision=1171721
This commit is contained in:
parent
33c240ffa4
commit
0c6ed54a52
@ -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<Plasma::Package>().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);
|
||||
|
Loading…
Reference in New Issue
Block a user