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