when the contianment goes away, zero our pointer to it

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=871483
This commit is contained in:
Aaron J. Seigo 2008-10-15 00:26:42 +00:00
parent 9c6184b1bf
commit 725c0c3137
2 changed files with 8 additions and 0 deletions

View File

@ -80,6 +80,11 @@ public:
emit q->sceneRectChanged();
}
void containmentDestroyed()
{
containment = 0;
}
void initGraphicsView()
{
q->setFrameShape(QFrame::NoFrame);
@ -189,6 +194,7 @@ void View::setContainment(Plasma::Containment *containment)
}
if (d->containment) {
disconnect(containment, SIGNAL(destroyed()), this, SLOT(containmentDestroyed()));
disconnect(d->containment, SIGNAL(geometryChanged()), this, SLOT(updateSceneRect()));
d->containment->removeAssociatedWidget(this);
}
@ -236,6 +242,7 @@ void View::setContainment(Plasma::Containment *containment)
}
d->updateSceneRect();
connect(containment, SIGNAL(destroyed()), this, SLOT(containmentDestroyed()));
connect(containment, SIGNAL(geometryChanged()), this, SLOT(updateSceneRect()));
}

1
view.h
View File

@ -191,6 +191,7 @@ private:
ViewPrivate * const d;
Q_PRIVATE_SLOT(d, void updateSceneRect())
Q_PRIVATE_SLOT(d, void containmentDestroyed())
friend class ViewPrivate;
};