fix resolution of paths w/ only a packageRoot+name
This commit is contained in:
parent
ecc8692c33
commit
14c3235a17
17
package.cpp
17
package.cpp
@ -128,7 +128,7 @@ Package::Package()
|
||||
|
||||
Package::Package(const QString &packageRoot, const QString &package,
|
||||
PackageStructure::Ptr structure)
|
||||
: d(new PackagePrivate(structure, packageRoot + '/' + package))
|
||||
: d(new PackagePrivate(structure, packageRoot, package))
|
||||
{
|
||||
}
|
||||
|
||||
@ -767,6 +767,21 @@ PackagePrivate::PackagePrivate(const PackageStructure::Ptr st, const QString &p)
|
||||
valid = structure && !structure->path().isEmpty();
|
||||
}
|
||||
|
||||
PackagePrivate::PackagePrivate(const PackageStructure::Ptr st, const QString &packageRoot, const QString &path)
|
||||
: structure(st),
|
||||
service(0)
|
||||
{
|
||||
if (structure) {
|
||||
if (packageRoot.isEmpty()) {
|
||||
structure->setPath(structure->defaultPackageRoot()%"/"%path);
|
||||
} else {
|
||||
structure->setPath(packageRoot%path);
|
||||
}
|
||||
}
|
||||
|
||||
valid = structure && !structure->path().isEmpty();
|
||||
}
|
||||
|
||||
PackagePrivate::PackagePrivate(const PackagePrivate &other)
|
||||
: structure(other.structure),
|
||||
service(other.service),
|
||||
|
@ -148,7 +148,7 @@ PackageStructure::Ptr PackageStructure::load(const QString &packageFormat)
|
||||
} else if (packageFormat == "Plasma/Generic") {
|
||||
structure = defaultPackageStructure(GenericComponent);
|
||||
structure->d->type = "Plasma/Generic";
|
||||
structure->setDefaultPackageRoot(KStandardDirs::locate("data", "plasmapackages"));
|
||||
structure->setDefaultPackageRoot(KStandardDirs::locate("data", "plasma/packages/"));
|
||||
}
|
||||
|
||||
if (structure) {
|
||||
|
@ -32,6 +32,7 @@ class PackagePrivate
|
||||
{
|
||||
public:
|
||||
PackagePrivate(const PackageStructure::Ptr st, const QString &p);
|
||||
PackagePrivate(const PackageStructure::Ptr st, const QString &packageRoot, const QString &path);
|
||||
PackagePrivate(const PackagePrivate &other);
|
||||
~PackagePrivate();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user