* don't emit updateGeometry twice

* fix coding style

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=800757
This commit is contained in:
Aaron J. Seigo 2008-04-24 19:48:04 +00:00
parent a9d9dfea46
commit 9425318d08

View File

@ -1524,21 +1524,17 @@ void Applet::setGeometry(const QRectF& geometry)
{
QRectF beforeGeom = QGraphicsWidget::geometry();
QGraphicsWidget::setGeometry(geometry);
if (geometry.size() != beforeGeom.size())
{
updateConstraints(Plasma::SizeConstraint);
if (d->background) {
d->background->resizePanel(boundingRect().size());
}
emit geometryChanged();
}
if (geometry.topLeft() != beforeGeom.topLeft())
{
if (d->background) {
kDebug() << QGraphicsWidget::geometry();
}
emit geometryChanged();
if (geometry.size() != beforeGeom.size()) {
updateConstraints(Plasma::SizeConstraint);
if (d->background) {
d->background->resizePanel(boundingRect().size());
}
emit geometryChanged();
} else if (geometry.topLeft() != beforeGeom.topLeft()) {
/*if (d->background) {
kDebug() << QGraphicsWidget::geometry();
}*/
emit geometryChanged();
}
}