From 3e518b755a0715215cbbb4aad979fe63c7082d6e Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Fri, 25 Apr 2008 03:27:30 +0000 Subject: [PATCH] more private slots svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=800877 --- containment.cpp | 20 +++++++++++--------- containment.h | 4 ++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/containment.cpp b/containment.cpp index 88e970df4..cf6c01e1d 100644 --- a/containment.cpp +++ b/containment.cpp @@ -120,6 +120,8 @@ public: * Repositions the Plasma toolbox. Useful to ensure its always in the correct place within the view. */ void repositionToolbox(); + void appletDestroyed(QObject*); + void appletAnimationComplete(QGraphicsItem *item, Plasma::Animator::Animation anim); Applet* addApplet(const QString& name, const QVariantList& args = QVariantList(), const QRectF &geometry = QRectF(-1, -1, -1, -1), uint id = 0, @@ -792,25 +794,25 @@ bool Containment::Private::regionIsEmpty(const QRectF ®ion, Applet *ignoredAp return true; } -void Containment::appletDestroyed(QObject* object) +void Containment::Private::appletDestroyed(QObject* object) { // we do a static_cast here since it really isn't an Applet by this // point anymore since we are in the qobject dtor. we don't actually // try and do anything with it, we just need the value of the pointer // so this unsafe looking code is actually just fine. Applet* applet = static_cast(object); - d->applets.removeAll(applet); - emit appletRemoved(applet); - emit configNeedsSaving(); + applets.removeAll(applet); + emit q->appletRemoved(applet); + emit q->configNeedsSaving(); } -void Containment::appletAnimationComplete(QGraphicsItem *item, Plasma::Animator::Animation anim) +void Containment::Private::appletAnimationComplete(QGraphicsItem *item, Plasma::Animator::Animation anim) { if (anim == Animator::DisappearAnimation) { QGraphicsItem *parent = item->parentItem(); while (parent) { - if (parent == this) { + if (parent == q) { Applet *applet = qgraphicsitem_cast(item); if (applet) { @@ -823,10 +825,10 @@ void Containment::appletAnimationComplete(QGraphicsItem *item, Plasma::Animator: parent = parent->parentItem(); } } else if (anim == Animator::AppearAnimation) { - if (containmentType() == DesktopContainment && - item->parentItem() == this && + if (q->containmentType() == DesktopContainment && + item->parentItem() == q && qgraphicsitem_cast(item)) { - item->installSceneEventFilter(this); + item->installSceneEventFilter(q); } } } diff --git a/containment.h b/containment.h index 37bd45f6f..e0b06d7b6 100644 --- a/containment.h +++ b/containment.h @@ -399,11 +399,11 @@ class PLASMA_EXPORT Containment : public Applet /** * @internal */ - void appletDestroyed(QObject*); - void appletAnimationComplete(QGraphicsItem *item, Plasma::Animator::Animation anim); void dropEvent(QGraphicsSceneDragDropEvent* event); private: + Q_PRIVATE_SLOT(d, void appletDestroyed(QObject*)); + Q_PRIVATE_SLOT(d, void appletAnimationComplete(QGraphicsItem *item, Plasma::Animator::Animation anim)); Q_PRIVATE_SLOT(d, void triggerShowAddWidgets()) Q_PRIVATE_SLOT(d, void handleDisappeared(AppletHandle *handle)); Q_PRIVATE_SLOT(d, void destroyApplet());