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,
|
Package::Package(const QString &packageRoot, const QString &package,
|
||||||
PackageStructure::Ptr structure)
|
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();
|
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)
|
PackagePrivate::PackagePrivate(const PackagePrivate &other)
|
||||||
: structure(other.structure),
|
: structure(other.structure),
|
||||||
service(other.service),
|
service(other.service),
|
||||||
|
|
|
@ -148,7 +148,7 @@ PackageStructure::Ptr PackageStructure::load(const QString &packageFormat)
|
||||||
} else if (packageFormat == "Plasma/Generic") {
|
} else if (packageFormat == "Plasma/Generic") {
|
||||||
structure = defaultPackageStructure(GenericComponent);
|
structure = defaultPackageStructure(GenericComponent);
|
||||||
structure->d->type = "Plasma/Generic";
|
structure->d->type = "Plasma/Generic";
|
||||||
structure->setDefaultPackageRoot(KStandardDirs::locate("data", "plasmapackages"));
|
structure->setDefaultPackageRoot(KStandardDirs::locate("data", "plasma/packages/"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structure) {
|
if (structure) {
|
||||||
|
|
|
@ -32,6 +32,7 @@ class PackagePrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PackagePrivate(const PackageStructure::Ptr st, const QString &p);
|
PackagePrivate(const PackageStructure::Ptr st, const QString &p);
|
||||||
|
PackagePrivate(const PackageStructure::Ptr st, const QString &packageRoot, const QString &path);
|
||||||
PackagePrivate(const PackagePrivate &other);
|
PackagePrivate(const PackagePrivate &other);
|
||||||
~PackagePrivate();
|
~PackagePrivate();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user