Commit d7e7c342 authored by con's avatar con
Browse files

Fix updating of menus with EA_Hide.

parent 59004d3d
...@@ -150,7 +150,7 @@ using namespace Core::Internal; ...@@ -150,7 +150,7 @@ using namespace Core::Internal;
ActionContainerPrivate::ActionContainerPrivate(int id) ActionContainerPrivate::ActionContainerPrivate(int id)
: m_data(0), m_id(id), m_updateRequested(false) : m_data(0), m_id(id), m_updateRequested(false)
{ {
scheduleUpdate();
} }
void ActionContainerPrivate::setEmptyAction(EmptyAction ea) void ActionContainerPrivate::setEmptyAction(EmptyAction ea)
...@@ -251,6 +251,7 @@ void ActionContainerPrivate::addAction(Command *action, int pos, bool setpos) ...@@ -251,6 +251,7 @@ void ActionContainerPrivate::addAction(Command *action, int pos, bool setpos)
m_posmap.insert(pos, action->id()); m_posmap.insert(pos, action->id());
connect(action, SIGNAL(activeStateChanged()), this, SLOT(scheduleUpdate())); connect(action, SIGNAL(activeStateChanged()), this, SLOT(scheduleUpdate()));
insertAction(ba, a->action()); insertAction(ba, a->action());
scheduleUpdate();
} }
void ActionContainerPrivate::addMenu(ActionContainer *menu, int pos, bool setpos) void ActionContainerPrivate::addMenu(ActionContainer *menu, int pos, bool setpos)
...@@ -271,6 +272,7 @@ void ActionContainerPrivate::addMenu(ActionContainer *menu, int pos, bool setpos ...@@ -271,6 +272,7 @@ void ActionContainerPrivate::addMenu(ActionContainer *menu, int pos, bool setpos
m_subContainers.append(menu); m_subContainers.append(menu);
m_posmap.insert(pos, menu->id()); m_posmap.insert(pos, menu->id());
insertMenu(ba, mc->menu()); insertMenu(ba, mc->menu());
scheduleUpdate();
} }
QAction *ActionContainerPrivate::beforeAction(int pos, int *prevKey) const QAction *ActionContainerPrivate::beforeAction(int pos, int *prevKey) const
...@@ -418,9 +420,9 @@ bool MenuActionContainer::updateInternal() ...@@ -418,9 +420,9 @@ bool MenuActionContainer::updateInternal()
} }
if (hasEmptyAction(EA_Hide)) if (hasEmptyAction(EA_Hide))
m_menu->setVisible(hasitems); m_menu->menuAction()->setVisible(hasitems);
else if (hasEmptyAction(EA_Disable)) else if (hasEmptyAction(EA_Disable))
m_menu->setEnabled(hasitems); m_menu->menuAction()->setEnabled(hasitems);
return hasitems; return hasitems;
} }
......
...@@ -255,11 +255,6 @@ QList<Command *> ActionManagerPrivate::commands() const ...@@ -255,11 +255,6 @@ QList<Command *> ActionManagerPrivate::commands() const
return result; return result;
} }
QList<ActionContainerPrivate *> ActionManagerPrivate::containers() const
{
return m_idContainerMap.values();
}
bool ActionManagerPrivate::hasContext(int context) const bool ActionManagerPrivate::hasContext(int context) const
{ {
return m_context.contains(context); return m_context.contains(context);
......
...@@ -72,7 +72,6 @@ public: ...@@ -72,7 +72,6 @@ public:
QList<int> defaultGroups() const; QList<int> defaultGroups() const;
QList<Command *> commands() const; QList<Command *> commands() const;
QList<ActionContainerPrivate *> containers() const;
bool hasContext(int context) const; bool hasContext(int context) const;
......
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