be sure to not insert the same action two times

svn path=/trunk/KDE/kdelibs/; revision=1147196
This commit is contained in:
Marco Martin 2010-07-07 15:59:02 +00:00
parent 93a955c984
commit 396972c468
3 changed files with 11 additions and 0 deletions

View File

@ -544,6 +544,10 @@ void DesktopToolBox::addTool(QAction *action)
return;
}
if (actions().contains(action)) {
return;
}
InternalToolBox::addTool(action);
Plasma::IconWidget *tool = new Plasma::IconWidget(toolParent());

View File

@ -116,6 +116,11 @@ QGraphicsWidget *InternalToolBox::toolParent()
return this;
}
QList<QAction *> InternalToolBox::actions() const
{
return d->actions;
}
void InternalToolBox::addTool(QAction *action)
{
if (!action) {

View File

@ -95,6 +95,8 @@ public:
virtual void showToolBox() = 0;
virtual void hideToolBox() = 0;
QList<QAction *> actions() const;
protected:
Containment *containment();
QPoint toolPosition(int toolHeight);