more private slots

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=800877
This commit is contained in:
Aaron J. Seigo 2008-04-25 03:27:30 +00:00
parent 72db181c7c
commit 3e518b755a
2 changed files with 13 additions and 11 deletions

View File

@ -120,6 +120,8 @@ public:
* Repositions the Plasma toolbox. Useful to ensure its always in the correct place within the view. * Repositions the Plasma toolbox. Useful to ensure its always in the correct place within the view.
*/ */
void repositionToolbox(); void repositionToolbox();
void appletDestroyed(QObject*);
void appletAnimationComplete(QGraphicsItem *item, Plasma::Animator::Animation anim);
Applet* addApplet(const QString& name, const QVariantList& args = QVariantList(), Applet* addApplet(const QString& name, const QVariantList& args = QVariantList(),
const QRectF &geometry = QRectF(-1, -1, -1, -1), uint id = 0, const QRectF &geometry = QRectF(-1, -1, -1, -1), uint id = 0,
@ -792,25 +794,25 @@ bool Containment::Private::regionIsEmpty(const QRectF &region, Applet *ignoredAp
return true; 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 // 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 // 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 // try and do anything with it, we just need the value of the pointer
// so this unsafe looking code is actually just fine. // so this unsafe looking code is actually just fine.
Applet* applet = static_cast<Plasma::Applet*>(object); Applet* applet = static_cast<Plasma::Applet*>(object);
d->applets.removeAll(applet); applets.removeAll(applet);
emit appletRemoved(applet); emit q->appletRemoved(applet);
emit configNeedsSaving(); 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) { if (anim == Animator::DisappearAnimation) {
QGraphicsItem *parent = item->parentItem(); QGraphicsItem *parent = item->parentItem();
while (parent) { while (parent) {
if (parent == this) { if (parent == q) {
Applet *applet = qgraphicsitem_cast<Applet*>(item); Applet *applet = qgraphicsitem_cast<Applet*>(item);
if (applet) { if (applet) {
@ -823,10 +825,10 @@ void Containment::appletAnimationComplete(QGraphicsItem *item, Plasma::Animator:
parent = parent->parentItem(); parent = parent->parentItem();
} }
} else if (anim == Animator::AppearAnimation) { } else if (anim == Animator::AppearAnimation) {
if (containmentType() == DesktopContainment && if (q->containmentType() == DesktopContainment &&
item->parentItem() == this && item->parentItem() == q &&
qgraphicsitem_cast<Applet*>(item)) { qgraphicsitem_cast<Applet*>(item)) {
item->installSceneEventFilter(this); item->installSceneEventFilter(q);
} }
} }
} }

View File

@ -399,11 +399,11 @@ class PLASMA_EXPORT Containment : public Applet
/** /**
* @internal * @internal
*/ */
void appletDestroyed(QObject*);
void appletAnimationComplete(QGraphicsItem *item, Plasma::Animator::Animation anim);
void dropEvent(QGraphicsSceneDragDropEvent* event); void dropEvent(QGraphicsSceneDragDropEvent* event);
private: 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 triggerShowAddWidgets())
Q_PRIVATE_SLOT(d, void handleDisappeared(AppletHandle *handle)); Q_PRIVATE_SLOT(d, void handleDisappeared(AppletHandle *handle));
Q_PRIVATE_SLOT(d, void destroyApplet()); Q_PRIVATE_SLOT(d, void destroyApplet());