From 6329eb7af471e3a41feccd9ffaa0b657b89a3614 Mon Sep 17 00:00:00 2001 From: David Redondo Date: Mon, 13 Jul 2020 16:57:53 +0200 Subject: [PATCH] Expose the applet metadata in AppletInterface Needed for displaying about pages of applets. --- src/scriptengines/qml/plasmoid/appletinterface.cpp | 5 +++++ src/scriptengines/qml/plasmoid/appletinterface.h | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/scriptengines/qml/plasmoid/appletinterface.cpp b/src/scriptengines/qml/plasmoid/appletinterface.cpp index c348594c8..e3843b490 100644 --- a/src/scriptengines/qml/plasmoid/appletinterface.cpp +++ b/src/scriptengines/qml/plasmoid/appletinterface.cpp @@ -884,4 +884,9 @@ bool AppletInterface::isLoading() const return m_loading; } +KPluginMetaData AppletInterface::metaData() const +{ + return applet()->pluginMetaData(); +} + #include "moc_appletinterface.cpp" diff --git a/src/scriptengines/qml/plasmoid/appletinterface.h b/src/scriptengines/qml/plasmoid/appletinterface.h index 711c2879a..a6e4f2a9c 100644 --- a/src/scriptengines/qml/plasmoid/appletinterface.h +++ b/src/scriptengines/qml/plasmoid/appletinterface.h @@ -25,6 +25,8 @@ #include #include +#include + #include #include @@ -250,6 +252,12 @@ class AppletInterface : public PlasmaQuick::AppletQuickItem Q_PROPERTY(bool loading MEMBER m_loading NOTIFY isLoadingChanged) + /** + * The metadata of the applet. + * @since 5.73 + */ + Q_PROPERTY(KPluginMetaData metaData READ metaData CONSTANT) + public: AppletInterface(DeclarativeAppletScript *script, const QVariantList &args = QVariantList(), QQuickItem *parent = nullptr); ~AppletInterface() override; @@ -416,6 +424,8 @@ public: QString configurationRequiredReason() const; void setConfigurationRequiredReason(const QString &reason); + KPluginMetaData metaData() const; + Q_SIGNALS: /** * somebody else, usually the containment sent some data to the applet