check that we have children; prevents crash. will continue polishing from the fairgrounds later today.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=814045
This commit is contained in:
Aaron J. Seigo 2008-05-29 08:49:40 +00:00
parent 88e4985e4a
commit 1d5979e532

View File

@ -702,9 +702,13 @@ void Applet::flushPendingConstraintsEvents()
if (c & Plasma::SizeConstraint && d->needsConfigOverlay) {
d->needsConfigOverlay->setGeometry(QRectF(QPointF(0, 0), boundingRect().size()));
// FIXME:: rather horrible hack to work around the fact we don't have spacers
// for layouts, and with WoC coming i'd rather not expend effort there
QGraphicsItem * button = d->needsConfigOverlay->QGraphicsItem::children().first();
QGraphicsItem *button = 0;
QList<QGraphicsItem*> children = d->needsConfigOverlay->QGraphicsItem::children();
if (!children.isEmpty()) {
button = children.first();
}
if (button) {
QSizeF s = button->boundingRect().size();
button->setPos(d->needsConfigOverlay->boundingRect().width() / 2 - s.width() / 2,