Commit 684f8725 authored by con's avatar con
Browse files

Remove unused internal "CommandLocation".

parent b94d100e
......@@ -205,7 +205,7 @@ void ActionContainerPrivate::addAction(Command *action, const QString &group)
if (!m_groups.contains(grpid) && !am->defaultGroups().contains(grpid))
qWarning() << "*** addAction(): Unknown group: " << group;
int pos = ((grpid << 16) | 0xFFFF);
addAction(action, pos, true);
addActionInternal(action, pos);
}
void ActionContainerPrivate::addMenu(ActionContainer *menu, const QString &group)
......@@ -222,7 +222,7 @@ void ActionContainerPrivate::addMenu(ActionContainer *menu, const QString &group
if (!m_groups.contains(grpid) && !am->defaultGroups().contains(grpid))
qWarning() << "*** addMenu(): Unknown group: " << group;
int pos = ((grpid << 16) | 0xFFFF);
addMenu(menu, pos, true);
addMenuInternal(menu, pos);
}
int ActionContainerPrivate::id() const
......@@ -245,22 +245,13 @@ bool ActionContainerPrivate::canAddAction(Command *action) const
return (action->action() != 0);
}
void ActionContainerPrivate::addAction(Command *action, int pos, bool setpos)
void ActionContainerPrivate::addActionInternal(Command *action, int pos)
{
Action *a = static_cast<Action *>(action);
int prevKey = 0;
QAction *ba = beforeAction(pos, &prevKey);
if (setpos) {
pos = calcPosition(pos, prevKey);
CommandLocation loc;
loc.m_container = m_id;
loc.m_position = pos;
QList<CommandLocation> locs = a->locations();
locs.append(loc);
a->setLocations(locs);
}
pos = calcPosition(pos, prevKey);
m_commands.append(action);
m_posmap.insert(pos, action->id());
......@@ -269,20 +260,13 @@ void ActionContainerPrivate::addAction(Command *action, int pos, bool setpos)
scheduleUpdate();
}
void ActionContainerPrivate::addMenu(ActionContainer *menu, int pos, bool setpos)
void ActionContainerPrivate::addMenuInternal(ActionContainer *menu, int pos)
{
MenuActionContainer *mc = static_cast<MenuActionContainer *>(menu);
int prevKey = 0;
QAction *ba = beforeAction(pos, &prevKey);
if (setpos) {
pos = calcPosition(pos, prevKey);
CommandLocation loc;
loc.m_container = m_id;
loc.m_position = pos;
mc->setLocation(loc);
}
pos = calcPosition(pos, prevKey);
m_subContainers.append(menu);
m_posmap.insert(pos, menu->id());
......@@ -386,16 +370,6 @@ void MenuActionContainer::insertMenu(QAction *before, QMenu *menu)
m_menu->insertMenu(before, menu);
}
void MenuActionContainer::setLocation(const CommandLocation &location)
{
m_location = location;
}
CommandLocation MenuActionContainer::location() const
{
return m_location;
}
bool MenuActionContainer::updateInternal()
{
if (onAllDisabledBehavior() == Show)
......
......@@ -76,8 +76,8 @@ protected:
bool canAddMenu(ActionContainer *menu) const;
virtual bool canBeAddedToMenu() const = 0;
void addAction(Command *action, int pos, bool setpos);
void addMenu(ActionContainer *menu, int pos, bool setpos);
void addActionInternal(Command *action, int pos);
void addMenuInternal(ActionContainer *menu, int pos);
private slots:
void scheduleUpdate();
......@@ -104,9 +104,6 @@ public:
void setMenu(QMenu *menu);
QMenu *menu() const;
void setLocation(const CommandLocation &location);
CommandLocation location() const;
void insertAction(QAction *before, QAction *action);
void insertMenu(QAction *before, QMenu *menu);
......@@ -116,7 +113,6 @@ protected:
private:
QMenu *m_menu;
CommandLocation m_location;
};
class MenuBarActionContainer : public ActionContainerPrivate
......
......@@ -403,16 +403,6 @@ QAction *Action::action() const
return m_action;
}
void Action::setLocations(const QList<CommandLocation> &locations)
{
m_locations = locations;
}
QList<CommandLocation> Action::locations() const
{
return m_locations;
}
void Action::setKeySequence(const QKeySequence &key)
{
CommandPrivate::setKeySequence(key);
......
......@@ -45,12 +45,6 @@
#include <QtCore/QMap>
#include <QtGui/QKeySequence>
struct CommandLocation
{
int m_container;
int m_position;
};
namespace Core {
namespace Internal {
......@@ -135,9 +129,6 @@ public:
QAction *action() const;
void setLocations(const QList<CommandLocation> &locations);
QList<CommandLocation> locations() const;
void setCurrentContext(const Context &context);
bool isActive() const;
void addOverrideAction(QAction *action, const Context &context, bool scriptable);
......@@ -157,7 +148,6 @@ private:
void setActive(bool state);
Utils::ProxyAction *m_action;
QList<CommandLocation> m_locations;
QString m_toolTip;
QMap<int, QPointer<QAction> > m_contextActionMap;
......
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