don't use PackageMetadata

This commit is contained in:
Aaron Seigo 2011-05-31 00:03:39 +02:00
parent 61dae1cad0
commit be8b64f95c
2 changed files with 10 additions and 7 deletions

View File

@ -413,16 +413,23 @@ void AbstractRunnerPrivate::init(const KService::Ptr service)
void AbstractRunnerPrivate::init(const QString &path)
{
prepScripting(path);
runnerDescription = KPluginInfo(path + "/metadata.desktop");
const QString api = runnerDescription.property("X-Plasma-API").toString();
prepScripting(path, api);
}
void AbstractRunnerPrivate::prepScripting(const QString &path, QString api)
void AbstractRunnerPrivate::prepScripting(const QString &path, const QString &api)
{
if (script) {
return;
}
delete package;
package = 0;
if (api.isEmpty()) {
return;
}
PackageStructure::Ptr structure = Plasma::packageStructure(api, Plasma::RunnerComponent);
structure->setPath(path);
@ -435,10 +442,6 @@ void AbstractRunnerPrivate::prepScripting(const QString &path, QString api)
return;
}
if (api.isEmpty()) {
api = package->metadata().implementationApi();
}
script = Plasma::loadScriptEngine(api, runner);
if (!script) {
delete package;

View File

@ -36,7 +36,7 @@ public:
~AbstractRunnerPrivate();
void init(const KService::Ptr service);
void init(const QString &path);
void prepScripting(const QString &path, QString api = QString());
void prepScripting(const QString &path, const QString &api);
void setupScriptSupport();
AbstractRunner::Priority priority;