From 9c638f076d53ca8844405b0249b010e00a46d81c Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Sun, 16 Mar 2008 07:19:27 +0000 Subject: [PATCH] * remove the screen based ctor. now we always require a containment. * move some code into setContainment that was always needed, not just in setScreen * fix a boolean logic error svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=786174 --- view.cpp | 29 +++++++++++------------------ view.h | 1 - 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/view.cpp b/view.cpp index 558778063..b16687a77 100644 --- a/view.cpp +++ b/view.cpp @@ -48,15 +48,6 @@ public: Plasma::Containment *containment; }; -View::View(int screen, Corona *corona, QWidget *parent) - : QGraphicsView(parent), - d(new Private) -{ - initGraphicsView(); - setScene(corona); - setScreen(screen); -} - View::View(Containment *containment, QWidget *parent) : QGraphicsView(parent), d(new Private) @@ -95,11 +86,6 @@ void View::setScreen(int screen) } setContainment(corona->containmentForScreen(screen)); - if (d->desktop < -1) { - // we want to set it to "all desktops" if we get ownership of - // a screen but don't have a desktop set - d->desktop = -1; - } } } @@ -143,11 +129,15 @@ void View::setContainment(Containment *containment) } d->containment = containment; - updateSceneRect(); - if (containment) { - connect(containment, SIGNAL(geometryChanged()), this, SLOT(updateSceneRect())); + if (containment->screen() > -1 && d->desktop < -1) { + // we want to set it to "all desktops" if we get ownership of + // a screen but don't have a desktop explicitly set + d->desktop = -1; } + + updateSceneRect(); + connect(containment, SIGNAL(geometryChanged()), this, SLOT(updateSceneRect())); } Containment* View::containment() const @@ -167,11 +157,14 @@ bool View::drawWallpaper() const void View::updateSceneRect() { - //kDebug( )<< "!!!!!!!!!!!!!!!!! setting the scene rect to" << d->containment->sceneBoundingRect(); if (!d->containment) { return; } + kDebug() << "!!!!!!!!!!!!!!!!! setting the scene rect to" + << d->containment->sceneBoundingRect() + << "associated screen is" << d->containment->screen(); + emit sceneRectAboutToChange(); setSceneRect(d->containment->sceneBoundingRect()); emit sceneRectChanged(); diff --git a/view.h b/view.h index 79c7f54ef..d8f71e424 100644 --- a/view.h +++ b/view.h @@ -38,7 +38,6 @@ class PLASMA_EXPORT View : public QGraphicsView Q_OBJECT public: - View(int screen, Corona *corona, QWidget *parent = 0); explicit View(Containment *containment, QWidget *parent = 0); ~View();