From 725c0c3137b244142e0896f78e97adce494249d3 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Wed, 15 Oct 2008 00:26:42 +0000 Subject: [PATCH] when the contianment goes away, zero our pointer to it svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=871483 --- view.cpp | 7 +++++++ view.h | 1 + 2 files changed, 8 insertions(+) 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; };