diff --git a/package.cpp b/package.cpp index b4f927c33..4ed187485 100644 --- a/package.cpp +++ b/package.cpp @@ -344,7 +344,8 @@ bool Package::registerPackage(const PackageMetadata &data, const QString &iconPa KDesktopFile config(service); KConfigGroup cg = config.desktopGroup(); - cg.writeEntry("Type", "Service"); + const QString type = data.type().isEmpty() ? "Service" : data.type(); + cg.writeEntry("Type", type); const QString serviceTypes = data.serviceType().isNull() ? "Plasma/Applet,Plasma/Containment" : data.serviceType(); cg.writeEntry("X-KDE-ServiceTypes", serviceTypes); cg.writeEntry("X-KDE-PluginInfo-EnabledByDefault", true); diff --git a/packagemetadata.cpp b/packagemetadata.cpp index b27fec087..af12155d5 100644 --- a/packagemetadata.cpp +++ b/packagemetadata.cpp @@ -30,6 +30,11 @@ namespace Plasma class PackageMetadataPrivate { public: + PackageMetadataPrivate() + : type("Service") + { + } + QString name; QString description; QString author; @@ -38,6 +43,7 @@ class PackageMetadataPrivate QString website; QString license; QString app; + QString category; QString requiredVersion; QString pluginName; QString type; @@ -86,7 +92,7 @@ void PackageMetadata::write(const QString &filename) const config.writeEntry("X-KDE-PluginInfo-Version", d->version); config.writeEntry("X-KDE-PluginInfo-Website", d->website); config.writeEntry("X-KDE-PluginInfo-License", d->license); - config.writeEntry("X-KDE-PluginInfo-Category", d->type); + config.writeEntry("X-KDE-PluginInfo-Category", d->category); config.writeEntry("X-Plasma-API", d->api); config.writeEntry("X-KDE-Plasmagik-ApplicationName", d->app); config.writeEntry("X-KDE-Plasmagik-RequiredVersion", d->requiredVersion); @@ -106,7 +112,8 @@ void PackageMetadata::read(const QString& filename) d->version = config.readEntry("X-KDE-PluginInfo-Version", d->version); d->website = config.readEntry("X-KDE-PluginInfo-Website", d->website); d->license = config.readEntry("X-KDE-PluginInfo-License", d->license); - d->type = config.readEntry("X-KDE-PluginInfo-Category", d->type); + d->type = config.readEntry("Type", d->type); + d->category = config.readEntry("X-KDE-PluginInfo-Category", d->category); d->app = config.readEntry("X-KDE-Plasmagik-ApplicationName", d->app); d->requiredVersion = config.readEntry("X-KDE-Plasmagik-RequiredVersion", d->requiredVersion); } @@ -156,6 +163,11 @@ QString PackageMetadata::application() const return d->app; } +QString PackageMetadata::category() const +{ + return d->category; +} + QString PackageMetadata::requiredVersion() const { return d->requiredVersion; @@ -231,6 +243,11 @@ void PackageMetadata::setApplication(const QString &application) d->app = application; } +void PackageMetadata::setCategory(const QString &category) +{ + d->category = category; +} + void PackageMetadata::setRequiredVersion(const QString &requiredVersion) { d->requiredVersion = requiredVersion; diff --git a/packagemetadata.h b/packagemetadata.h index 39d693e1c..2c075f7e9 100644 --- a/packagemetadata.h +++ b/packagemetadata.h @@ -76,6 +76,7 @@ public: QString website() const; QString license() const; QString application() const; + QString category() const; QString requiredVersion() const; QString pluginName() const; QString implementationApi() const; @@ -136,6 +137,11 @@ public: */ void setApplication(const QString &); + /** + * Sets the category this package belongs in + */ + void setCategory(const QString &); + /** * Set the required version. See also the setVersion() * method.