diff --git a/view.cpp b/view.cpp index 6fa19368c..87dba539a 100644 --- a/view.cpp +++ b/view.cpp @@ -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())); } diff --git a/view.h b/view.h index 8a4f43d50..91d64beb6 100644 --- a/view.h +++ b/view.h @@ -191,6 +191,7 @@ private: ViewPrivate * const d; Q_PRIVATE_SLOT(d, void updateSceneRect()) + Q_PRIVATE_SLOT(d, void containmentDestroyed()) friend class ViewPrivate; };