don't add empty extender groups that are autohide

BUG:258645

svn path=/trunk/KDE/kdelibs/; revision=1212326
This commit is contained in:
Marco Martin 2011-01-06 14:55:41 +00:00
parent 79bbb39468
commit 0069c38934

View File

@ -489,6 +489,11 @@ void Extender::dropEvent(QGraphicsSceneDragDropEvent *event)
void Extender::itemAddedEvent(ExtenderItem *item, const QPointF &pos) void Extender::itemAddedEvent(ExtenderItem *item, const QPointF &pos)
{ {
ExtenderGroup *group = item->isGroup()?static_cast<ExtenderGroup*>(item):0;
if (group && group->autoHide() && group->items().isEmpty()) {
return;
}
if (!item->group()) { if (!item->group()) {
if (pos == QPointF(-1, -1)) { if (pos == QPointF(-1, -1)) {
//if it was already there, reposition //if it was already there, reposition