diff --git a/containment.cpp b/containment.cpp index a38c8aec3..782c64842 100644 --- a/containment.cpp +++ b/containment.cpp @@ -479,25 +479,6 @@ Location Containment::location() const return d->location; } -void Containment::toggleDesktopImmutability() -{ - if (corona()) { - if (corona()->immutability() == NotImmutable) { - corona()->setImmutability(UserImmutable); - } else if (corona()->immutability() == UserImmutable) { - corona()->setImmutability(NotImmutable); - } - } else { - if (immutability() == NotImmutable) { - setImmutability(UserImmutable); - } else if (immutability() == UserImmutable) { - setImmutability(NotImmutable); - } - } - - d->setLockToolText(); -} - void Containment::addSiblingContainment() { emit addSiblingContainment(this); @@ -894,6 +875,25 @@ void Containment::closeToolBox() // Private class implementation +void Containment::Private::toggleDesktopImmutability() +{ + if (q->corona()) { + if (q->corona()->immutability() == NotImmutable) { + q->corona()->setImmutability(UserImmutable); + } else if (q->corona()->immutability() == UserImmutable) { + q->corona()->setImmutability(NotImmutable); + } + } else { + if (q->immutability() == NotImmutable) { + q->setImmutability(UserImmutable); + } else if (q->immutability() == UserImmutable) { + q->setImmutability(NotImmutable); + } + } + + setLockToolText(); +} + void Containment::Private::zoomIn() { emit q->zoomRequested(q, Plasma::ZoomIn); diff --git a/containment.h b/containment.h index 607bcdb05..a0d7ed618 100644 --- a/containment.h +++ b/containment.h @@ -333,13 +333,6 @@ class PLASMA_EXPORT Containment : public Applet */ void setFormFactor(Plasma::FormFactor formFactor); - /** - * Locks or unlocks plasma's applets. - * When plasma is locked, applets cannot be transformed, added or deleted - * but they can still be configured. - */ - void toggleDesktopImmutability(); - /** * Tells the corona to create a new desktop containment */ @@ -383,6 +376,7 @@ class PLASMA_EXPORT Containment : public Applet Q_PRIVATE_SLOT(d, void positionToolBox()) Q_PRIVATE_SLOT(d, void zoomIn()) Q_PRIVATE_SLOT(d, void zoomOut()) + Q_PRIVATE_SLOT(d, void toggleDesktopImmutability()); friend class Applet; class Private; diff --git a/containment_p.h b/containment_p.h index e743fe046..55257ed9c 100644 --- a/containment_p.h +++ b/containment_p.h @@ -72,6 +72,13 @@ public: void zoomIn(); void zoomOut(); + /** + * Locks or unlocks plasma's applets. + * When plasma is locked, applets cannot be transformed, added or deleted + * but they can still be configured. + */ + void toggleDesktopImmutability(); + Applet* addApplet(const QString& name, const QVariantList& args = QVariantList(), const QRectF &geometry = QRectF(-1, -1, -1, -1), uint id = 0, bool delayedInit = false);