be sure to remove the tool from the tool collection if it gets deleted because the action was removed
svn path=/trunk/KDE/kdelibs/; revision=1084451
This commit is contained in:
parent
d69885df4d
commit
8fc5c0d2b0
@ -165,7 +165,16 @@ void InternalToolBox::addTool(QAction *action)
|
|||||||
void InternalToolBox::updateToolBox()
|
void InternalToolBox::updateToolBox()
|
||||||
{
|
{
|
||||||
Plasma::IconWidget *tool = qobject_cast<Plasma::IconWidget *>(sender());
|
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->deleteLater();
|
||||||
tool = 0;
|
tool = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user