Fix some problems aseigo pointed out in the code.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=780655
This commit is contained in:
Dan Meltzer 2008-02-29 17:43:35 +00:00
parent a081559257
commit 64f0ce7739
3 changed files with 10 additions and 24 deletions

View File

@ -1014,7 +1014,8 @@ QSizeF Applet::contentSizeHint() const
} else {
size = contentSize();
}
//FIXME: This causes infinite recursion in qt code.. maximumContentSize calls
//sizeHint.. which eventually calls contentSizeHint again.
// QSizeF max = maximumContentSize();
// size = size.boundedTo(max);
// if (d->square) {

View File

@ -555,24 +555,10 @@ void Containment::addApplet(Applet *applet, const QPointF &pos, bool delayInit)
if (containmentType() == PanelContainment) {
// Reposition the applet after adding has been done
if (index != -1) {
QGraphicsLinearLayout *l = dynamic_cast<QGraphicsLinearLayout *>(layout());
int i = 1;
for (; i< l->count(); i++) {
if (l->itemAt(i) == applet) {
break;
}
}
l->insertItem(index, l->itemAt(i));
l->removeAt(i); //FIXME: takeAt no longer works.. which means that this may not be totally correct..
applet->setParentLayoutItem(this);
d->applets.removeAll(applet);
d->applets.insert(index, applet);
} else {
QGraphicsLinearLayout *l = dynamic_cast<QGraphicsLinearLayout*>(layout());
Q_ASSERT(l);
l->addItem(applet);
}
} else {
//FIXME if it came from a panel its bg was disabled
//maybe we should expect the applet to handle that on a constraint update?

View File

@ -251,7 +251,6 @@ void Corona::loadApplets(const QString& configName)
}
Applet *applet = c->addApplet(plugin, QVariantList(), appId, appletConfig.readEntry("geometry", QRectF()), true);
addItem(applet);
applet->restore(&appletConfig);
}
}