prevent duplicate actions in the toolbox

BUG:200981

svn path=/trunk/KDE/kdelibs/; revision=1016829
This commit is contained in:
Aaron J. Seigo 2009-08-29 00:33:27 +00:00
parent 6b5a36dbd3
commit 37f65858dc

View File

@ -111,6 +111,14 @@ void ToolBox::addTool(QAction *action)
return;
}
foreach (QGraphicsItem *child, QGraphicsItem::children()) {
//kDebug() << "checking tool" << child << child->data(ToolName);
Plasma::IconWidget *tool = dynamic_cast<Plasma::IconWidget*>(child);
if (tool && tool->action() == action) {
return;
}
}
Plasma::IconWidget *tool = new Plasma::IconWidget(this);
tool->setTextBackgroundColor(QColor());