Move shared code into KoToolBox::addButton()

parent f050f7bd
......@@ -106,7 +106,6 @@ KoToolBox::KoToolBox()
setLayout(d->layout);
foreach(const KoToolButton & button, KoToolManager::instance()->createToolList()) {
addButton(button);
d->visibilityCodes.insert(button.button, button.visibilityCode);
}
// Update visibility of buttons
......@@ -166,6 +165,8 @@ void KoToolBox::addButton(const KoToolButton &button)
d->buttonGroup->addButton(button.button);
else
d->buttonGroup->addButton(button.button, button.buttonGroupId);
d->visibilityCodes.insert(button.button, button.visibilityCode);
}
void KoToolBox::setActiveTool(KoCanvasController *canvas, int id)
......@@ -281,7 +282,6 @@ void KoToolBox::toolAdded(const KoToolButton &button, KoCanvasController *canvas
{
Q_UNUSED(canvas);
addButton(button);
d->visibilityCodes.insert(button.button, button.visibilityCode);
setButtonsVisible(QList<QString>());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment