only remove it implicitly from our layout if the item is actually being removed from us (not just being stuffed into a child); in the case of a child becoming a grandchild, it will need to be explicitly added to a new layout or removed from an existing one.

prevents applethandle from causing applets to be removed from the FreeLayout in the DefaultDesktopp containment, as seen by Ivan

CCMAIL:panel-devel@kde.org

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=785670
This commit is contained in:
Aaron J. Seigo 2008-03-14 16:59:10 +00:00
parent c9dd0f1dd6
commit 25476574a3

View File

@ -270,6 +270,7 @@ void Widget::setGeometry(const QRectF& geometry)
}
if (managingLayout()) {
//kDebug() << "invalidating managing layout";
managingLayout()->invalidate();
}
}
@ -409,7 +410,7 @@ void Widget::paintWidget(QPainter *painter, const QStyleOptionGraphicsItem *opti
QVariant Widget::itemChange(GraphicsItemChange change, const QVariant &value)
{
if (change == QGraphicsItem::ItemChildRemovedChange) {
if (layout()) {
if (layout() && !isAncestorOf(value.value<QGraphicsItem*>())) {
layout()->removeItem(dynamic_cast<Plasma::LayoutItem*>(value.value<QGraphicsItem*>()));
updateGeometry();
}