diff --git a/src/scriptengines/qml/plasmoid/appletinterface.cpp b/src/scriptengines/qml/plasmoid/appletinterface.cpp index 876af2ced..06abd8519 100644 --- a/src/scriptengines/qml/plasmoid/appletinterface.cpp +++ b/src/scriptengines/qml/plasmoid/appletinterface.cpp @@ -66,7 +66,7 @@ AppletInterface::AppletInterface(DeclarativeAppletScript *script, const QVariant connect(this, &AppletInterface::configNeedsSaving, applet(), &Plasma::Applet::configNeedsSaving); connect(applet(), &Plasma::Applet::immutabilityChanged, - this, &AppletInterface::immutableChanged); + this, &AppletInterface::immutabilityChanged); connect(applet(), &Plasma::Applet::userConfiguringChanged, this, &AppletInterface::userConfiguringChanged); @@ -137,7 +137,7 @@ AppletInterface::AppletInterface(Plasma::Applet *a, const QVariantList &args, QQ connect(this, &AppletInterface::configNeedsSaving, applet(), &Plasma::Applet::configNeedsSaving); connect(applet(), &Plasma::Applet::immutabilityChanged, - this, &AppletInterface::immutableChanged); + this, &AppletInterface::immutabilityChanged); connect(applet(), &Plasma::Applet::userConfiguringChanged, this, &AppletInterface::userConfiguringChanged); connect(applet(), &Plasma::Applet::configurationRequiredChanged, @@ -535,6 +535,11 @@ bool AppletInterface::immutable() const return applet()->immutability() != Plasma::Types::Mutable; } +Plasma::Types::ImmutabilityType AppletInterface::immutability() const +{ + return applet()->immutability(); +} + bool AppletInterface::userConfiguring() const { return applet()->isUserConfiguring(); diff --git a/src/scriptengines/qml/plasmoid/appletinterface.h b/src/scriptengines/qml/plasmoid/appletinterface.h index 6cf71aa9d..b86ed9b92 100644 --- a/src/scriptengines/qml/plasmoid/appletinterface.h +++ b/src/scriptengines/qml/plasmoid/appletinterface.h @@ -149,9 +149,21 @@ class AppletInterface : public PlasmaQuick::AppletQuickItem Q_PROPERTY(Plasma::Types::BackgroundHints backgroundHints WRITE setBackgroundHints READ backgroundHints NOTIFY backgroundHintsChanged) /** - * The immutability state of the Corona. the plasmoid implementation should avoid allowing "dangerous" modifications from the user when in an immutable mode + * Whether the Corona is immutable. The plasmoid implementation should avoid allowing "dangerous" modifications from the user when in an immutable mode + * + * This is true when immutability is not Mutable */ - Q_PROPERTY(bool immutable READ immutable NOTIFY immutableChanged) + Q_PROPERTY(bool immutable READ immutable NOTIFY immutabilityChanged) + + /** + * The immutability of the Corona. + * + * Use this if you need more granular control than just using the immutable property + * + * @see immutable + * @since 5.23 + */ + Q_PROPERTY(Plasma::Types::ImmutabilityType immutability READ immutability NOTIFY immutabilityChanged) /** * True when the user is configuring, for instance when the configuration dialog is open. @@ -337,6 +349,7 @@ public: QRect screenGeometry() const; bool immutable() const; + Plasma::Types::ImmutabilityType immutability() const; bool userConfiguring() const; int apiVersion() const; @@ -388,7 +401,7 @@ Q_SIGNALS: void formFactorChanged(); void locationChanged(); void contextChanged(); - void immutableChanged(); + void immutabilityChanged(); void statusChanged(); void backgroundHintsChanged(); void busyChanged();