From 364aabf0735efdbc7cb15dd8209dd51fb3b2c782 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Mon, 25 Aug 2008 19:25:15 +0000 Subject: [PATCH] drop the requirement of a containment on construction svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=852337 --- view.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/view.cpp b/view.cpp index 99acf1b36..4e55c8e61 100644 --- a/view.cpp +++ b/view.cpp @@ -108,20 +108,24 @@ View::View(Containment *containment, QWidget *parent) : QGraphicsView(parent), d(new ViewPrivate(this, 0)) { - Q_ASSERT(containment); d->initGraphicsView(); - setScene(containment->scene()); - setContainment(containment); + + if (containment) { + setScene(containment->scene()); + setContainment(containment); + } } View::View(Containment *containment, int viewId, QWidget *parent) : QGraphicsView(parent), d(new ViewPrivate(this, viewId)) { - Q_ASSERT(containment); d->initGraphicsView(); - setScene(containment->scene()); - setContainment(containment); + + if (containment) { + setScene(containment->scene()); + setContainment(containment); + } } @@ -200,6 +204,8 @@ void View::setContainment(Plasma::Containment *containment) int screen = -1; if (oldContainment) { screen = d->containment->screen(); + } else { + setScene(containment->scene()); } d->containment = containment;