From 28acadf899e74e666838fb6916250f239e6e2b47 Mon Sep 17 00:00:00 2001 From: con <qtc-committer@nokia.com> Date: Wed, 14 Jan 2009 12:25:54 +0100 Subject: [PATCH] Fixes: - ActionContainer --> ActionContainerPrivate Details: - Preparation for IActionContainer --> ActionContainer --- .../actionmanager/actioncontainer.cpp | 56 +++++++++---------- ...{actioncontainer.h => actioncontainer_p.h} | 16 +++--- .../actionmanager/actionmanager.cpp | 4 +- .../actionmanager/actionmanager_p.h | 6 +- src/plugins/coreplugin/coreplugin.pro | 2 +- src/plugins/coreplugin/mainwindow.cpp | 2 +- 6 files changed, 43 insertions(+), 43 deletions(-) rename src/plugins/coreplugin/actionmanager/{actioncontainer.h => actioncontainer_p.h} (91%) diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer.cpp b/src/plugins/coreplugin/actionmanager/actioncontainer.cpp index 881cd0826f3..ea441ecfe82 100644 --- a/src/plugins/coreplugin/actionmanager/actioncontainer.cpp +++ b/src/plugins/coreplugin/actionmanager/actioncontainer.cpp @@ -31,7 +31,7 @@ ** ***************************************************************************/ -#include "actioncontainer.h" +#include "actioncontainer_p.h" #include "actionmanager_p.h" #include "command.h" @@ -116,47 +116,47 @@ using namespace Core::Internal; \fn virtual IActionContainer::~IActionContainer() */ -// ---------- ActionContainer ------------ +// ---------- ActionContainerPrivate ------------ /*! - \class Core::Internal::ActionContainer + \class Core::Internal::ActionContainerPrivate \internal */ -ActionContainer::ActionContainer(int id) +ActionContainerPrivate::ActionContainerPrivate(int id) : m_data(CS_None), m_id(id) { } -void ActionContainer::setEmptyAction(EmptyAction ea) +void ActionContainerPrivate::setEmptyAction(EmptyAction ea) { m_data = ((m_data & ~EA_Mask) | ea); } -bool ActionContainer::hasEmptyAction(EmptyAction ea) const +bool ActionContainerPrivate::hasEmptyAction(EmptyAction ea) const { return (m_data & EA_Mask) == ea; } -void ActionContainer::setState(ContainerState state) +void ActionContainerPrivate::setState(ContainerState state) { m_data |= state; } -bool ActionContainer::hasState(ContainerState state) const +bool ActionContainerPrivate::hasState(ContainerState state) const { return (m_data & state); } -void ActionContainer::appendGroup(const QString &group) +void ActionContainerPrivate::appendGroup(const QString &group) { UniqueIDManager *idmanager = CoreImpl::instance()->uniqueIDManager(); int gid = idmanager->uniqueIdentifier(group); m_groups << gid; } -QAction *ActionContainer::insertLocation(const QString &group) const +QAction *ActionContainerPrivate::insertLocation(const QString &group) const { UniqueIDManager *idmanager = CoreImpl::instance()->uniqueIDManager(); int grpid = idmanager->uniqueIdentifier(group); @@ -165,7 +165,7 @@ QAction *ActionContainer::insertLocation(const QString &group) const return beforeAction(pos, &prevKey); } -void ActionContainer::addAction(ICommand *action, const QString &group) +void ActionContainerPrivate::addAction(ICommand *action, const QString &group) { if (!canAddAction(action)) return; @@ -176,7 +176,7 @@ void ActionContainer::addAction(ICommand *action, const QString &group) QList<CommandLocation> locs = a->locations(); for (int i=0; i<locs.size(); ++i) { if (IActionContainer *aci = am->actionContainer(locs.at(i).m_container)) { - ActionContainer *ac = static_cast<ActionContainer *>(aci); + ActionContainerPrivate *ac = static_cast<ActionContainerPrivate *>(aci); ac->addAction(action, locs.at(i).m_position, false); } } @@ -193,21 +193,21 @@ void ActionContainer::addAction(ICommand *action, const QString &group) } } -void ActionContainer::addMenu(IActionContainer *menu, const QString &group) +void ActionContainerPrivate::addMenu(IActionContainer *menu, const QString &group) { - ActionContainer *container = static_cast<ActionContainer *>(menu); + ActionContainerPrivate *container = static_cast<ActionContainerPrivate *>(menu); if (!container->canBeAddedToMenu()) return; ActionManagerPrivate *am = ActionManagerPrivate::instance(); MenuActionContainer *mc = static_cast<MenuActionContainer *>(menu); - if (mc->hasState(ActionContainer::CS_PreLocation)) { + if (mc->hasState(ActionContainerPrivate::CS_PreLocation)) { CommandLocation loc = mc->location(); if (IActionContainer *aci = am->actionContainer(loc.m_container)) { - ActionContainer *ac = static_cast<ActionContainer *>(aci); + ActionContainerPrivate *ac = static_cast<ActionContainerPrivate *>(aci); ac->addMenu(menu, loc.m_position, false); } - mc->setState(ActionContainer::CS_Initialized); + mc->setState(ActionContainerPrivate::CS_Initialized); } else { UniqueIDManager *idmanager = CoreImpl::instance()->uniqueIDManager(); int grpid = idmanager->uniqueIdentifier(Constants::G_DEFAULT_TWO); @@ -220,22 +220,22 @@ void ActionContainer::addMenu(IActionContainer *menu, const QString &group) } } -int ActionContainer::id() const +int ActionContainerPrivate::id() const { return m_id; } -QMenu *ActionContainer::menu() const +QMenu *ActionContainerPrivate::menu() const { return 0; } -QMenuBar *ActionContainer::menuBar() const +QMenuBar *ActionContainerPrivate::menuBar() const { return 0; } -bool ActionContainer::canAddAction(ICommand *action) const +bool ActionContainerPrivate::canAddAction(ICommand *action) const { if (action->type() != ICommand::CT_OverridableAction) return false; @@ -247,7 +247,7 @@ bool ActionContainer::canAddAction(ICommand *action) const return true; } -void ActionContainer::addAction(ICommand *action, int pos, bool setpos) +void ActionContainerPrivate::addAction(ICommand *action, int pos, bool setpos) { Action *a = static_cast<Action *>(action); @@ -269,7 +269,7 @@ void ActionContainer::addAction(ICommand *action, int pos, bool setpos) insertAction(ba, a->action()); } -void ActionContainer::addMenu(IActionContainer *menu, int pos, bool setpos) +void ActionContainerPrivate::addMenu(IActionContainer *menu, int pos, bool setpos) { MenuActionContainer *mc = static_cast<MenuActionContainer *>(menu); @@ -289,7 +289,7 @@ void ActionContainer::addMenu(IActionContainer *menu, int pos, bool setpos) insertMenu(ba, mc->menu()); } -QAction *ActionContainer::beforeAction(int pos, int *prevKey) const +QAction *ActionContainerPrivate::beforeAction(int pos, int *prevKey) const { ActionManagerPrivate *am = ActionManagerPrivate::instance(); @@ -319,7 +319,7 @@ QAction *ActionContainer::beforeAction(int pos, int *prevKey) const return 0; } -int ActionContainer::calcPosition(int pos, int prevKey) const +int ActionContainerPrivate::calcPosition(int pos, int prevKey) const { int grp = (pos & 0xFFFF0000); if (prevKey == -1) @@ -341,7 +341,7 @@ int ActionContainer::calcPosition(int pos, int prevKey) const */ MenuActionContainer::MenuActionContainer(int id) - : ActionContainer(id), m_menu(0) + : ActionContainerPrivate(id), m_menu(0) { setEmptyAction(EA_Disable); } @@ -417,7 +417,7 @@ bool MenuActionContainer::update() bool MenuActionContainer::canBeAddedToMenu() const { - if (hasState(ActionContainer::CS_Initialized)) + if (hasState(ActionContainerPrivate::CS_Initialized)) return false; return true; @@ -432,7 +432,7 @@ bool MenuActionContainer::canBeAddedToMenu() const */ MenuBarActionContainer::MenuBarActionContainer(int id) - : ActionContainer(id), m_menuBar(0) + : ActionContainerPrivate(id), m_menuBar(0) { setEmptyAction(EA_None); } diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer.h b/src/plugins/coreplugin/actionmanager/actioncontainer_p.h similarity index 91% rename from src/plugins/coreplugin/actionmanager/actioncontainer.h rename to src/plugins/coreplugin/actionmanager/actioncontainer_p.h index 025de13a2b3..1212a4f2f7f 100644 --- a/src/plugins/coreplugin/actionmanager/actioncontainer.h +++ b/src/plugins/coreplugin/actionmanager/actioncontainer_p.h @@ -31,8 +31,8 @@ ** ***************************************************************************/ -#ifndef ACTIONCONTAINER_H -#define ACTIONCONTAINER_H +#ifndef ACTIONCONTAINER_P_H +#define ACTIONCONTAINER_P_H #include "actionmanager_p.h" @@ -42,7 +42,7 @@ namespace Core { namespace Internal { -class ActionContainer : public Core::IActionContainer +class ActionContainerPrivate : public Core::IActionContainer { public: enum ContainerState { @@ -52,8 +52,8 @@ public: CS_UserDefined = 0x040000 }; - ActionContainer(int id); - virtual ~ActionContainer() {} + ActionContainerPrivate(int id); + virtual ~ActionContainerPrivate() {} void setEmptyAction(EmptyAction ea); bool hasEmptyAction(EmptyAction ea) const; @@ -96,7 +96,7 @@ private: QList<ICommand *> m_commands; }; -class MenuActionContainer : public ActionContainer +class MenuActionContainer : public ActionContainerPrivate { public: MenuActionContainer(int id); @@ -118,7 +118,7 @@ private: CommandLocation m_location; }; -class MenuBarActionContainer : public ActionContainer +class MenuBarActionContainer : public ActionContainerPrivate { public: MenuBarActionContainer(int id); @@ -139,4 +139,4 @@ private: } // namespace Internal } // namespace Core -#endif // ACTIONCONTAINER_H +#endif // ACTIONCONTAINER_P_H diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.cpp b/src/plugins/coreplugin/actionmanager/actionmanager.cpp index e9afea6e654..08609d6dd9a 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager.cpp +++ b/src/plugins/coreplugin/actionmanager/actionmanager.cpp @@ -33,7 +33,7 @@ #include "actionmanager_p.h" #include "mainwindow.h" -#include "actioncontainer.h" +#include "actioncontainer_p.h" #include "command.h" #include "uniqueidmanager.h" @@ -238,7 +238,7 @@ QList<Command *> ActionManagerPrivate::commands() const return m_idCmdMap.values(); } -QList<ActionContainer *> ActionManagerPrivate::containers() const +QList<ActionContainerPrivate *> ActionManagerPrivate::containers() const { return m_idContainerMap.values(); } diff --git a/src/plugins/coreplugin/actionmanager/actionmanager_p.h b/src/plugins/coreplugin/actionmanager/actionmanager_p.h index 0364268f03b..87899468b3b 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager_p.h +++ b/src/plugins/coreplugin/actionmanager/actionmanager_p.h @@ -56,7 +56,7 @@ class UniqueIDManager; namespace Internal { -class ActionContainer; +class ActionContainerPrivate; class MainWindow; class Command; @@ -75,7 +75,7 @@ public: QList<int> defaultGroups() const; QList<Command *> commands() const; - QList<ActionContainer *> containers() const; + QList<ActionContainerPrivate *> containers() const; bool hasContext(int context) const; @@ -107,7 +107,7 @@ private: typedef QHash<int, Command *> IdCmdMap; IdCmdMap m_idCmdMap; - typedef QHash<int, ActionContainer *> IdContainerMap; + typedef QHash<int, ActionContainerPrivate *> IdContainerMap; IdContainerMap m_idContainerMap; // typedef QMap<int, int> GlobalGroupMap; diff --git a/src/plugins/coreplugin/coreplugin.pro b/src/plugins/coreplugin/coreplugin.pro index 3823b96e45a..6c02c8de069 100644 --- a/src/plugins/coreplugin/coreplugin.pro +++ b/src/plugins/coreplugin/coreplugin.pro @@ -103,7 +103,7 @@ HEADERS += mainwindow.h \ actionmanager/icommand.h \ actionmanager/actionmanager_p.h \ actionmanager/command.h \ - actionmanager/actioncontainer.h \ + actionmanager/actioncontainer_p.h \ actionmanager/commandsfile.h \ dialogs/saveitemsdialog.h \ dialogs/newdialog.h \ diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index b268b8ea394..8ec698ae074 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -32,7 +32,7 @@ ***************************************************************************/ #include "mainwindow.h" -#include "actioncontainer.h" +#include "iactioncontainer.h" #include "actionmanager_p.h" #include "basemode.h" #include "coreimpl.h" -- GitLab