* 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
This commit is contained in:
parent
6b53321428
commit
9c638f076d
29
view.cpp
29
view.cpp
@ -48,15 +48,6 @@ public:
|
|||||||
Plasma::Containment *containment;
|
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)
|
View::View(Containment *containment, QWidget *parent)
|
||||||
: QGraphicsView(parent),
|
: QGraphicsView(parent),
|
||||||
d(new Private)
|
d(new Private)
|
||||||
@ -95,11 +86,6 @@ void View::setScreen(int screen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
setContainment(corona->containmentForScreen(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;
|
d->containment = containment;
|
||||||
updateSceneRect();
|
|
||||||
|
|
||||||
if (containment) {
|
if (containment->screen() > -1 && d->desktop < -1) {
|
||||||
connect(containment, SIGNAL(geometryChanged()), this, SLOT(updateSceneRect()));
|
// 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
|
Containment* View::containment() const
|
||||||
@ -167,11 +157,14 @@ bool View::drawWallpaper() const
|
|||||||
|
|
||||||
void View::updateSceneRect()
|
void View::updateSceneRect()
|
||||||
{
|
{
|
||||||
//kDebug( )<< "!!!!!!!!!!!!!!!!! setting the scene rect to" << d->containment->sceneBoundingRect();
|
|
||||||
if (!d->containment) {
|
if (!d->containment) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
kDebug() << "!!!!!!!!!!!!!!!!! setting the scene rect to"
|
||||||
|
<< d->containment->sceneBoundingRect()
|
||||||
|
<< "associated screen is" << d->containment->screen();
|
||||||
|
|
||||||
emit sceneRectAboutToChange();
|
emit sceneRectAboutToChange();
|
||||||
setSceneRect(d->containment->sceneBoundingRect());
|
setSceneRect(d->containment->sceneBoundingRect());
|
||||||
emit sceneRectChanged();
|
emit sceneRectChanged();
|
||||||
|
1
view.h
1
view.h
@ -38,7 +38,6 @@ class PLASMA_EXPORT View : public QGraphicsView
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
View(int screen, Corona *corona, QWidget *parent = 0);
|
|
||||||
explicit View(Containment *containment, QWidget *parent = 0);
|
explicit View(Containment *containment, QWidget *parent = 0);
|
||||||
~View();
|
~View();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user