a new PackageStructure type: GenericComponent

this component will be used for loading generic repositories of files,
usually will be repositories of QML files
This commit is contained in:
Marco Martin 2011-07-13 20:32:25 +02:00
parent 6ba042db73
commit a4d079975b
3 changed files with 11 additions and 2 deletions

View File

@ -757,8 +757,12 @@ PackagePrivate::PackagePrivate(const PackageStructure::Ptr st, const QString &p)
service(0) service(0)
{ {
if (structure) { if (structure) {
if (p.isEmpty()) {
structure->setPath(structure->defaultPackageRoot());
} else {
structure->setPath(p); structure->setPath(p);
} }
}
valid = structure && !structure->path().isEmpty(); valid = structure && !structure->path().isEmpty();
} }

View File

@ -145,6 +145,10 @@ PackageStructure::Ptr PackageStructure::load(const QString &packageFormat)
} else if (packageFormat == "Plasma/Theme") { } else if (packageFormat == "Plasma/Theme") {
structure = Theme::packageStructure(); structure = Theme::packageStructure();
structure->d->type = "Plasma/Theme"; structure->d->type = "Plasma/Theme";
} else if (packageFormat == "Plasma/Generic") {
structure = defaultPackageStructure(GenericComponent);
structure->d->type = "Plasma/Generic";
structure->setDefaultPackageRoot(KStandardDirs::locate("data", "plasmapackages"));
} }
if (structure) { if (structure) {

View File

@ -234,7 +234,8 @@ enum ComponentType {
RunnerComponent = 4, /**< Plasma::AbstractRunner based plugsin **/ RunnerComponent = 4, /**< Plasma::AbstractRunner based plugsin **/
AnimatorComponent = 8, /**< Plasma::Animator based plugins **/ AnimatorComponent = 8, /**< Plasma::Animator based plugins **/
ContainmentComponent = 16,/**< Plasma::Containment based plugins **/ ContainmentComponent = 16,/**< Plasma::Containment based plugins **/
WallpaperComponent = 32 /**< Plasma::Wallpaper based plugins **/ WallpaperComponent = 32, /**< Plasma::Wallpaper based plugins **/
GenericComponent = 64 /** Generic repositories of files, usually they keep QML files and their assets **/
}; };
Q_DECLARE_FLAGS(ComponentTypes, ComponentType) Q_DECLARE_FLAGS(ComponentTypes, ComponentType)