diff --git a/plasma/applet.cpp b/plasma/applet.cpp index d6541909b..282621528 100644 --- a/plasma/applet.cpp +++ b/plasma/applet.cpp @@ -212,7 +212,7 @@ void Applet::save(KConfigGroup &g) const // we call the dptr member directly for locked since isImmutable() // also checks kiosk and parent containers group.writeEntry("immutability", (int)d->immutability); - group.writeEntry("plugin", pluginName()); + group.writeEntry("plugin", d->appletDescription.pluginName()); if (!d->started) { return; @@ -423,13 +423,9 @@ QString Applet::icon() const return d->appletDescription.icon(); } -QString Applet::pluginName() const +KPluginInfo Applet::pluginInfo() const { - if (!d->appletDescription.isValid()) { - return d->mainConfigGroup()->readEntry("plugin", QString()); - } - - return d->appletDescription.pluginName(); + return d->appletDescription; } bool Applet::shouldConserveResources() const @@ -441,15 +437,6 @@ bool Applet::shouldConserveResources() const #endif } -QString Applet::category() const -{ - if (!d->appletDescription.isValid()) { - return i18nc("misc category", "Miscellaneous"); - } - - return d->appletDescription.category(); -} - QString Applet::category(const KPluginInfo &applet) { return applet.property("X-KDE-PluginInfo-Category").toString(); diff --git a/plasma/applet.h b/plasma/applet.h index 563ecb730..27fae6d98 100644 --- a/plasma/applet.h +++ b/plasma/applet.h @@ -234,6 +234,13 @@ class PLASMA_EXPORT Applet : public QObject //METADATA + /** + * @return metadata information about this plugin + * @see KPluginInfo + * @since 5.0 + */ + KPluginInfo pluginInfo() const; + /** * Returns the user-visible title for the applet, as specified in the * Name field of the .desktop file. Can be changed with @see setTitle @@ -346,22 +353,11 @@ class PLASMA_EXPORT Applet : public QObject */ static QString category(const QString &appletName); - /** - * Returns the plugin name for the applet - */ - QString pluginName() const; - /** * Returns the icon related to this applet **/ QString icon() const; - /** - * Returns the category the applet is in, as specified in the - * .desktop file. - */ - QString category() const; - /** * Whether the applet should conserve resources. If true, try to avoid doing stuff which * is computationally heavy. Try to conserve power and resources. diff --git a/plasma/private/storage.cpp b/plasma/private/storage.cpp index d48691c8a..9618a972a 100644 --- a/plasma/private/storage.cpp +++ b/plasma/private/storage.cpp @@ -129,7 +129,7 @@ Storage::Storage(QObject* parent) while ((parentObject = parentObject->parent())) { Plasma::Applet *applet = qobject_cast(parentObject); if (applet) { - m_clientName = applet->pluginName(); + m_clientName = applet->pluginInfo().pluginName(); break; } diff --git a/scriptengines/qml/plasmoid/appletinterface.cpp b/scriptengines/qml/plasmoid/appletinterface.cpp index 7e63d47ef..c6fd2a15f 100644 --- a/scriptengines/qml/plasmoid/appletinterface.cpp +++ b/scriptengines/qml/plasmoid/appletinterface.cpp @@ -353,7 +353,7 @@ QString AppletInterface::downloadPath(const QString &file) QStringList AppletInterface::downloadedFiles() const { - const QString downloadDir = KGlobalSettings::downloadPath() + "/Plasma/" + applet()->pluginName(); + const QString downloadDir = KGlobalSettings::downloadPath() + "/Plasma/" + applet()->pluginInfo().pluginName(); QDir dir(downloadDir); return dir.entryList(QDir::Files | QDir::NoSymLinks | QDir::Readable); }