diff --git a/private/toolbox.cpp b/private/toolbox.cpp index cf09af5b7..767d72f6a 100644 --- a/private/toolbox.cpp +++ b/private/toolbox.cpp @@ -131,10 +131,16 @@ void ToolBox::addTool(QAction *action) void ToolBox::updateToolBox() { + Plasma::IconWidget *tool = qobject_cast(sender()); + if (tool && tool->action() == 0) { + delete tool; + tool = 0; + } + if (d->showing) { d->showing = false; showToolBox(); - } else if (Plasma::IconWidget *tool = qobject_cast(sender())) { + } else if (tool && !tool->isEnabled()) { tool->hide(); } }