adapt to Package merge: return a Package by reference rather than a pointer
This commit is contained in:
parent
8d5cd041c0
commit
776fe21b83
@ -322,9 +322,9 @@ QString AbstractRunner::description() const
|
||||
return objectName();
|
||||
}
|
||||
|
||||
const Package* AbstractRunner::package() const
|
||||
Package AbstractRunner::package() const
|
||||
{
|
||||
return d->package;
|
||||
return d->package ? *d->package : Package();
|
||||
}
|
||||
|
||||
|
||||
@ -415,14 +415,11 @@ void AbstractRunnerPrivate::prepScripting(const QString &path, const QString &ap
|
||||
return;
|
||||
}
|
||||
|
||||
PackageStructure::Ptr structure = Plasma::packageStructure(api, Plasma::RunnerComponent);
|
||||
structure->setPath(path);
|
||||
package = new Package(path, structure);
|
||||
package = new Package(Plasma::Package::load("Plasma/Runner", api));
|
||||
package->setPath(path);
|
||||
|
||||
if (!package->isValid()) {
|
||||
kDebug() << "Invalid Runner package at" << path;
|
||||
delete package;
|
||||
package = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -442,7 +439,6 @@ void AbstractRunnerPrivate::setupScriptSupport()
|
||||
}
|
||||
|
||||
kDebug() << "setting up script support, package is in" << package->path()
|
||||
<< "which is a" << package->structure()->type() << "package"
|
||||
<< ", main script is" << package->filePath("mainscript");
|
||||
|
||||
const QString translationsPath = package->filePath("translations");
|
||||
|
@ -222,9 +222,9 @@ class PLASMA_EXPORT AbstractRunner : public QObject
|
||||
* Note that the returned pointer is only valid for the lifetime of
|
||||
* the runner.
|
||||
*
|
||||
* @return the Package object, or 0 if none
|
||||
* @return the Package object, which may be invalid
|
||||
**/
|
||||
const Package *package() const;
|
||||
Package package() const;
|
||||
|
||||
/**
|
||||
* Signal runner to reload its configuration.
|
||||
|
Loading…
x
Reference in New Issue
Block a user