be sure to remove the tool from the tool collection if it gets deleted because the action was removed
svn path=/branches/KDE/4.4/kdelibs/; revision=1084456
This commit is contained in:
parent
2a7ab28951
commit
e3cab4cc26
@ -167,7 +167,16 @@ void InternalToolBox::addTool(QAction *action)
|
||||
void InternalToolBox::updateToolBox()
|
||||
{
|
||||
Plasma::IconWidget *tool = qobject_cast<Plasma::IconWidget *>(sender());
|
||||
if (tool && tool->action() == 0) {
|
||||
if (tool && !tool->action()) {
|
||||
QMutableMapIterator<ToolType, IconWidget *> it(d->tools);
|
||||
while (it.hasNext()) {
|
||||
it.next();
|
||||
if (it.value() == tool) {
|
||||
it.remove();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tool->deleteLater();
|
||||
tool = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user