From c5e0d52ac398fbea59fef481213a381db847df3c Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Fri, 25 Apr 2008 19:15:50 +0000 Subject: [PATCH] toggleDesktopImmutability -> pimpl svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=801134 --- containment.cpp | 38 +++++++++++++++++++------------------- containment.h | 8 +------- containment_p.h | 7 +++++++ 3 files changed, 27 insertions(+), 26 deletions(-) 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);