From 684f8725e1677f5e631bbe67f236fa7ec3d6773b Mon Sep 17 00:00:00 2001 From: con Date: Mon, 17 Jan 2011 18:23:48 +0100 Subject: Remove unused internal "CommandLocation". --- .../coreplugin/actionmanager/actioncontainer.cpp | 38 ++++------------------ .../coreplugin/actionmanager/actioncontainer_p.h | 8 ++--- src/plugins/coreplugin/actionmanager/command.cpp | 10 ------ src/plugins/coreplugin/actionmanager/command_p.h | 10 ------ 4 files changed, 8 insertions(+), 58 deletions(-) (limited to 'src/plugins/coreplugin/actionmanager') diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer.cpp b/src/plugins/coreplugin/actionmanager/actioncontainer.cpp index 1b45c67608..f47313f569 100644 --- a/src/plugins/coreplugin/actionmanager/actioncontainer.cpp +++ b/src/plugins/coreplugin/actionmanager/actioncontainer.cpp @@ -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); 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 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(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) diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer_p.h b/src/plugins/coreplugin/actionmanager/actioncontainer_p.h index 4e375f76fd..6beae138ce 100644 --- a/src/plugins/coreplugin/actionmanager/actioncontainer_p.h +++ b/src/plugins/coreplugin/actionmanager/actioncontainer_p.h @@ -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 diff --git a/src/plugins/coreplugin/actionmanager/command.cpp b/src/plugins/coreplugin/actionmanager/command.cpp index 862da22431..e8ac5d3ed6 100644 --- a/src/plugins/coreplugin/actionmanager/command.cpp +++ b/src/plugins/coreplugin/actionmanager/command.cpp @@ -403,16 +403,6 @@ QAction *Action::action() const return m_action; } -void Action::setLocations(const QList &locations) -{ - m_locations = locations; -} - -QList Action::locations() const -{ - return m_locations; -} - void Action::setKeySequence(const QKeySequence &key) { CommandPrivate::setKeySequence(key); diff --git a/src/plugins/coreplugin/actionmanager/command_p.h b/src/plugins/coreplugin/actionmanager/command_p.h index 61b4a50811..406273e711 100644 --- a/src/plugins/coreplugin/actionmanager/command_p.h +++ b/src/plugins/coreplugin/actionmanager/command_p.h @@ -45,12 +45,6 @@ #include #include -struct CommandLocation -{ - int m_container; - int m_position; -}; - namespace Core { namespace Internal { @@ -135,9 +129,6 @@ public: QAction *action() const; - void setLocations(const QList &locations); - QList 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 m_locations; QString m_toolTip; QMap > m_contextActionMap; -- cgit v1.2.1