templateName and templateComment global variables accessible when running a template.

it says the name and comment fields of the package desktop file

svn path=/trunk/KDE/kdebase/workspace/; revision=1121162
This commit is contained in:
Marco Martin 2010-04-30 16:05:46 +00:00
parent 0ad362c94c
commit 2b42e85991

View File

@ -296,6 +296,8 @@ QScriptValue ScriptEngine::loadTemplate(QScriptContext *context, QScriptEngine *
}
ScriptEngine *env = envFor(engine);
env->globalObject().setProperty("templateName", env->newVariant(info.name()), QScriptValue::ReadOnly | QScriptValue::Undeletable);
env->globalObject().setProperty("templateComment", env->newVariant(info.comment()), QScriptValue::ReadOnly | QScriptValue::Undeletable);
env->evaluateScript(script, path);
return true;
}