be more careful with items being added more than once

svn path=/trunk/KDE/kdelibs/; revision=986691
This commit is contained in:
Aaron J. Seigo 2009-06-24 21:55:19 +00:00
parent 970766d468
commit a2cd3cdeec

View File

@ -411,7 +411,7 @@ void Extender::itemAddedEvent(ExtenderItem *item, const QPointF &pos)
{
if (pos == QPointF(-1, -1)) {
//if just plain adding an item, add it at a sane position:
if (!item->group()) {
if (!item->group()) {
if (appearance() == BottomUpStacked) {
//at the top
d->layout->insertItem(0, item);
@ -540,6 +540,11 @@ ExtenderPrivate::~ExtenderPrivate()
void ExtenderPrivate::addExtenderItem(ExtenderItem *item, const QPointF &pos)
{
if (attachedExtenderItems.contains(item)) {
q->itemAddedEvent(item, pos);
return;
}
attachedExtenderItems.append(item);
q->itemHoverLeaveEvent(item);
q->itemAddedEvent(item, pos);