Commit 2562b09f authored by con's avatar con

Fixes: - Rename ActionManager --> ActionManagerPrivate

Details:  - Step one, step two is ActionManagerInterface -->
ActionManager because it conflicts with our naming conventions
parent e2b9db7b
......@@ -32,6 +32,8 @@
***************************************************************************/
#include "actioncontainer.h"
#include "actionmanager_p.h"
#include "command.h"
#include "coreimpl.h"
......@@ -181,7 +183,7 @@ void ActionContainer::appendGroup(const QString &group, bool global)
int gid = idmanager->uniqueIdentifier(group);
m_groups << gid;
if (global)
ActionManager::instance()->registerGlobalGroup(gid, m_id);
ActionManagerPrivate::instance()->registerGlobalGroup(gid, m_id);
}
/*!
......@@ -220,7 +222,7 @@ void ActionContainer::addAction(ICommand *action, const QString &group)
if (!canAddAction(action))
return;
ActionManager *am = ActionManager::instance();
ActionManagerPrivate *am = ActionManagerPrivate::instance();
Action *a = static_cast<Action *>(action);
if (a->stateFlags() & Command::CS_PreLocation) {
QList<CommandLocation> locs = a->locations();
......@@ -251,7 +253,7 @@ void ActionContainer::addMenu(IActionContainer *menu, const QString &group)
if (!canAddMenu(menu))
return;
ActionManager *am = ActionManager::instance();
ActionManagerPrivate *am = ActionManagerPrivate::instance();
MenuActionContainer *mc = static_cast<MenuActionContainer *>(menu);
if (mc->hasState(ActionContainer::CS_PreLocation)) {
CommandLocation loc = mc->location();
......@@ -396,7 +398,7 @@ void ActionContainer::addMenu(IActionContainer *menu, int pos, bool setpos)
*/
QAction *ActionContainer::beforeAction(int pos, int *prevKey) const
{
ActionManager *am = ActionManager::instance();
ActionManagerPrivate *am = ActionManagerPrivate::instance();
int baId = -1;
......
......@@ -34,7 +34,7 @@
#ifndef ACTIONCONTAINER_H
#define ACTIONCONTAINER_H
#include "actionmanager.h"
#include "actionmanager_p.h"
#include <coreplugin/actionmanager/iactioncontainer.h>
#include <coreplugin/actionmanager/icommand.h>
......
......@@ -31,7 +31,7 @@
**
***************************************************************************/
#include "actionmanager.h"
#include "actionmanager_p.h"
#include "mainwindow.h"
#include "actioncontainer.h"
#include "command.h"
......@@ -146,7 +146,7 @@ namespace {
using namespace Core;
using namespace Core::Internal;
ActionManager* ActionManager::m_instance = 0;
ActionManagerPrivate* ActionManagerPrivate::m_instance = 0;
/*!
\class ActionManager
......@@ -159,7 +159,7 @@ ActionManager* ActionManager::m_instance = 0;
/*!
...
*/
ActionManager::ActionManager(MainWindow *mainWnd, UniqueIDManager *uidmgr) :
ActionManagerPrivate::ActionManagerPrivate(MainWindow *mainWnd, UniqueIDManager *uidmgr) :
ActionManagerInterface(mainWnd),
m_mainWnd(mainWnd)
{
......@@ -173,7 +173,7 @@ ActionManager::ActionManager(MainWindow *mainWnd, UniqueIDManager *uidmgr) :
/*!
...
*/
ActionManager::~ActionManager()
ActionManagerPrivate::~ActionManagerPrivate()
{
qDeleteAll(m_idCmdMap.values());
qDeleteAll(m_idContainerMap.values());
......@@ -182,7 +182,7 @@ ActionManager::~ActionManager()
/*!
...
*/
ActionManager* ActionManager::instance()
ActionManagerPrivate* ActionManagerPrivate::instance()
{
return m_instance;
}
......@@ -190,7 +190,7 @@ ActionManager* ActionManager::instance()
/*!
...
*/
QList<int> ActionManager::defaultGroups() const
QList<int> ActionManagerPrivate::defaultGroups() const
{
return m_defaultGroups;
}
......@@ -198,7 +198,7 @@ QList<int> ActionManager::defaultGroups() const
/*!
...
*/
QList<Command *> ActionManager::commands() const
QList<Command *> ActionManagerPrivate::commands() const
{
return m_idCmdMap.values();
}
......@@ -206,7 +206,7 @@ QList<Command *> ActionManager::commands() const
/*!
...
*/
QList<ActionContainer *> ActionManager::containers() const
QList<ActionContainer *> ActionManagerPrivate::containers() const
{
return m_idContainerMap.values();
}
......@@ -214,7 +214,7 @@ QList<ActionContainer *> ActionManager::containers() const
/*!
...
*/
void ActionManager::registerGlobalGroup(int groupId, int containerId)
void ActionManagerPrivate::registerGlobalGroup(int groupId, int containerId)
{
if (m_globalgroups.contains(groupId)) {
qWarning() << "registerGlobalGroup: Global group "
......@@ -228,7 +228,7 @@ void ActionManager::registerGlobalGroup(int groupId, int containerId)
/*!
...
*/
bool ActionManager::hasContext(int context) const
bool ActionManagerPrivate::hasContext(int context) const
{
return m_context.contains(context);
}
......@@ -236,7 +236,7 @@ bool ActionManager::hasContext(int context) const
/*!
...
*/
void ActionManager::setContext(const QList<int> &context)
void ActionManagerPrivate::setContext(const QList<int> &context)
{
// here are possibilities for speed optimization if necessary:
// let commands (de-)register themselves for contexts
......@@ -254,7 +254,7 @@ void ActionManager::setContext(const QList<int> &context)
/*!
\internal
*/
bool ActionManager::hasContext(QList<int> context) const
bool ActionManagerPrivate::hasContext(QList<int> context) const
{
for (int i=0; i<m_context.count(); ++i) {
if (context.contains(m_context.at(i)))
......@@ -266,7 +266,7 @@ bool ActionManager::hasContext(QList<int> context) const
/*!
...
*/
IActionContainer *ActionManager::createMenu(const QString &id)
IActionContainer *ActionManagerPrivate::createMenu(const QString &id)
{
const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id);
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid);
......@@ -287,7 +287,7 @@ IActionContainer *ActionManager::createMenu(const QString &id)
/*!
...
*/
IActionContainer *ActionManager::createMenuBar(const QString &id)
IActionContainer *ActionManagerPrivate::createMenuBar(const QString &id)
{
const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id);
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid);
......@@ -308,7 +308,7 @@ IActionContainer *ActionManager::createMenuBar(const QString &id)
/*!
...
*/
ICommand *ActionManager::registerAction(QAction *action, const QString &id, const QList<int> &context)
ICommand *ActionManagerPrivate::registerAction(QAction *action, const QString &id, const QList<int> &context)
{
OverrideableAction *a = 0;
ICommand *c = registerOverridableAction(action, id, false);
......@@ -321,7 +321,7 @@ ICommand *ActionManager::registerAction(QAction *action, const QString &id, cons
/*!
...
*/
ICommand *ActionManager::registerAction(QAction *action, const QString &id)
ICommand *ActionManagerPrivate::registerAction(QAction *action, const QString &id)
{
return registerOverridableAction(action, id, true);
}
......@@ -329,7 +329,7 @@ ICommand *ActionManager::registerAction(QAction *action, const QString &id)
/*!
\internal
*/
ICommand *ActionManager::registerOverridableAction(QAction *action, const QString &id, bool checkUnique)
ICommand *ActionManagerPrivate::registerOverridableAction(QAction *action, const QString &id, bool checkUnique)
{
OverrideableAction *a = 0;
const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id);
......@@ -378,7 +378,7 @@ ICommand *ActionManager::registerOverridableAction(QAction *action, const QStrin
/*!
...
*/
ICommand *ActionManager::registerShortcut(QShortcut *shortcut, const QString &id, const QList<int> &context)
ICommand *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const QString &id, const QList<int> &context)
{
Shortcut *sc = 0;
int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id);
......@@ -416,9 +416,9 @@ ICommand *ActionManager::registerShortcut(QShortcut *shortcut, const QString &id
}
/*!
\fn void ActionManager::addAction(Core::ICommand *action, const QString &globalGroup)
\fn void ActionManagerPrivate::addAction(Core::ICommand *action, const QString &globalGroup)
*/
void ActionManager::addAction(ICommand *action, const QString &globalGroup)
void ActionManagerPrivate::addAction(ICommand *action, const QString &globalGroup)
{
const int gid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(globalGroup);
if (!m_globalgroups.contains(gid)) {
......@@ -435,10 +435,10 @@ void ActionManager::addAction(ICommand *action, const QString &globalGroup)
}
/*!
\fn void ActionManager::addMenu(Core::IActionContainer *menu, const QString &globalGroup)
\fn void ActionManagerPrivate::addMenu(Core::IActionContainer *menu, const QString &globalGroup)
*/
void ActionManager::addMenu(IActionContainer *menu, const QString &globalGroup)
void ActionManagerPrivate::addMenu(IActionContainer *menu, const QString &globalGroup)
{
const int gid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(globalGroup);
if (!m_globalgroups.contains(gid)) {
......@@ -457,13 +457,13 @@ void ActionManager::addMenu(IActionContainer *menu, const QString &globalGroup)
/*!
...
*/
ICommand *ActionManager::command(const QString &id) const
ICommand *ActionManagerPrivate::command(const QString &id) const
{
const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id);
const IdCmdMap::const_iterator it = m_idCmdMap.constFind(uid);
if (it == m_idCmdMap.constEnd()) {
if (warnAboutFindFailures)
qWarning() << "ActionManager::command(): failed to find :" << id << '/' << uid;
qWarning() << "ActionManagerPrivate::command(): failed to find :" << id << '/' << uid;
return 0;
}
return it.value();
......@@ -472,13 +472,13 @@ ICommand *ActionManager::command(const QString &id) const
/*!
...
*/
IActionContainer *ActionManager::actionContainer(const QString &id) const
IActionContainer *ActionManagerPrivate::actionContainer(const QString &id) const
{
const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id);
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid);
if ( it == m_idContainerMap.constEnd()) {
if (warnAboutFindFailures)
qWarning() << "ActionManager::actionContainer(): failed to find :" << id << '/' << uid;
qWarning() << "ActionManagerPrivate::actionContainer(): failed to find :" << id << '/' << uid;
return 0;
}
return it.value();
......@@ -487,12 +487,12 @@ IActionContainer *ActionManager::actionContainer(const QString &id) const
/*!
...
*/
ICommand *ActionManager::command(int uid) const
ICommand *ActionManagerPrivate::command(int uid) const
{
const IdCmdMap::const_iterator it = m_idCmdMap.constFind(uid);
if (it == m_idCmdMap.constEnd()) {
if (warnAboutFindFailures)
qWarning() << "ActionManager::command(): failed to find :" << m_mainWnd->uniqueIDManager()->stringForUniqueIdentifier(uid) << '/' << uid;
qWarning() << "ActionManagerPrivate::command(): failed to find :" << m_mainWnd->uniqueIDManager()->stringForUniqueIdentifier(uid) << '/' << uid;
return 0;
}
return it.value();
......@@ -501,12 +501,12 @@ ICommand *ActionManager::command(int uid) const
/*!
...
*/
IActionContainer *ActionManager::actionContainer(int uid) const
IActionContainer *ActionManagerPrivate::actionContainer(int uid) const
{
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid);
if (it == m_idContainerMap.constEnd()) {
if (warnAboutFindFailures)
qWarning() << "ActionManager::actionContainer(): failed to find :" << m_mainWnd->uniqueIDManager()->stringForUniqueIdentifier(uid) << uid;
qWarning() << "ActionManagerPrivate::actionContainer(): failed to find :" << m_mainWnd->uniqueIDManager()->stringForUniqueIdentifier(uid) << uid;
return 0;
}
return it.value();
......@@ -519,7 +519,7 @@ static const char *sequenceKey = "Keysequence";
/*!
\internal
*/
void ActionManager::initialize()
void ActionManagerPrivate::initialize()
{
QSettings *settings = m_mainWnd->settings();
const int shortcuts = settings->beginReadArray(QLatin1String(settingsGroup));
......@@ -539,7 +539,7 @@ void ActionManager::initialize()
/*!
...
*/
void ActionManager::saveSettings(QSettings *settings)
void ActionManagerPrivate::saveSettings(QSettings *settings)
{
settings->beginWriteArray(QLatin1String(settingsGroup));
int count = 0;
......
......@@ -31,8 +31,8 @@
**
***************************************************************************/
#ifndef ACTIONMANAGER_H
#define ACTIONMANAGER_H
#ifndef ACTIONMANAGERPRIVATE_H
#define ACTIONMANAGERPRIVATE_H
#include <coreplugin/actionmanager/actionmanagerinterface.h>
......@@ -60,16 +60,16 @@ class ActionContainer;
class MainWindow;
class Command;
class ActionManager : public Core::ActionManagerInterface
class ActionManagerPrivate : public Core::ActionManagerInterface
{
Q_OBJECT
public:
ActionManager(MainWindow *mainWnd, UniqueIDManager *uidmgr);
~ActionManager();
ActionManagerPrivate(MainWindow *mainWnd, UniqueIDManager *uidmgr);
~ActionManagerPrivate();
void setContext(const QList<int> &context);
static ActionManager* instance();
static ActionManagerPrivate* instance();
void saveSettings(QSettings *settings);
QList<int> defaultGroups() const;
......@@ -107,7 +107,7 @@ private:
ICommand *registerOverridableAction(QAction *action, const QString &id,
bool checkUnique);
static ActionManager* m_instance;
static ActionManagerPrivate* m_instance;
QList<int> m_defaultGroups;
typedef QHash<int, Command *> IdCmdMap;
......@@ -127,4 +127,4 @@ private:
} // namespace Internal
} // namespace Core
#endif // ACTIONMANAGER_H
#endif // ACTIONMANAGERPRIVATE_H
......@@ -35,7 +35,7 @@
#define COMMAND_H
#include "icommand.h"
#include "actionmanager.h"
#include "actionmanager_p.h"
#include <QtCore/QList>
#include <QtCore/QMultiMap>
......
......@@ -101,7 +101,7 @@ HEADERS += mainwindow.h \
actionmanager/iactioncontainer.h \
actionmanager/actionmanagerinterface.h \
actionmanager/icommand.h \
actionmanager/actionmanager.h \
actionmanager/actionmanager_p.h \
actionmanager/command.h \
actionmanager/actioncontainer.h \
actionmanager/commandsfile.h \
......
......@@ -33,7 +33,7 @@
#include "shortcutsettings.h"
#include "ui_shortcutsettings.h"
#include "actionmanager.h"
#include "actionmanager_p.h"
#include "command.h"
#include "coreconstants.h"
#include "coreimpl.h"
......@@ -281,7 +281,7 @@ void ShortcutSettings::initialize()
{
QMap<QString, QTreeWidgetItem *> categories;
m_am = ActionManager::instance();
m_am = ActionManagerPrivate::instance();
UniqueIDManager *uidm =
CoreImpl::instance()->uniqueIDManager();
......
......@@ -51,7 +51,7 @@ class ICommand;
namespace Internal {
class ActionManager;
class ActionManagerPrivate;
class Command;
class MainWindow;
......@@ -101,7 +101,7 @@ private:
int translateModifiers(Qt::KeyboardModifiers state, const QString &text);
QList<ShortcutItem *> m_scitems;
ActionManager *m_am;
ActionManagerPrivate *m_am;
int m_key[4], m_keyNum;
Ui_ShortcutSettings *m_page;
};
......
......@@ -33,7 +33,7 @@
#include "mainwindow.h"
#include "actioncontainer.h"
#include "actionmanager.h"
#include "actionmanager_p.h"
#include "basemode.h"
#include "coreimpl.h"
#include "coreconstants.h"
......@@ -115,7 +115,7 @@ MainWindow::MainWindow() :
m_additionalContexts(m_globalContext),
m_settings(new QSettings(QSettings::IniFormat, QSettings::UserScope, QLatin1String("Nokia"), QLatin1String("QtCreator"), this)),
m_printer(0),
m_actionManager(new ActionManager(this, m_uniqueIDManager)),
m_actionManager(new ActionManagerPrivate(this, m_uniqueIDManager)),
m_editorManager(0),
m_fileManager(new FileManager(m_coreImpl, this)),
m_progressManager(new ProgressManager()),
......@@ -362,9 +362,9 @@ QStatusBar *MainWindow::statusBar() const
void MainWindow::registerDefaultContainers()
{
ActionManager *am = m_actionManager;
ActionManagerPrivate *am = m_actionManager;
IActionContainer *menubar = m_actionManager->createMenuBar(Constants::MENU_BAR);
IActionContainer *menubar = am->createMenuBar(Constants::MENU_BAR);
#ifndef Q_WS_MAC // System menu bar on Mac
setMenuBar(menubar->menuBar());
......@@ -427,7 +427,7 @@ void MainWindow::registerDefaultContainers()
ac->appendGroup(Constants::G_HELP_ABOUT, true);
}
static ICommand *createSeparator(ActionManager *am, QObject *parent,
static ICommand *createSeparator(ActionManagerPrivate *am, QObject *parent,
const QString &name,
const QList<int> &context)
{
......@@ -439,7 +439,7 @@ static ICommand *createSeparator(ActionManager *am, QObject *parent,
void MainWindow::registerDefaultActions()
{
ActionManager *am = m_actionManager;
ActionManagerPrivate *am = m_actionManager;
IActionContainer *mfile = am->actionContainer(Constants::M_FILE);
IActionContainer *medit = am->actionContainer(Constants::M_EDIT);
IActionContainer *mtools = am->actionContainer(Constants::M_TOOLS);
......
......@@ -74,7 +74,7 @@ class ViewManagerInterface;
namespace Internal {
class ActionManager;
class ActionManagerPrivate;
class CoreImpl;
class FancyTabWidget;
class GeneralSettings;
......@@ -176,7 +176,7 @@ private:
QList<int> m_additionalContexts;
QSettings *m_settings;
mutable QPrinter *m_printer;
ActionManager *m_actionManager;
ActionManagerPrivate *m_actionManager;
EditorManager *m_editorManager;
FileManager *m_fileManager;
MessageManager *m_messageManager;
......
......@@ -34,7 +34,7 @@
#include "taskwindow.h"
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actionmanagerinterface.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/uniqueidmanager.h>
......
......@@ -49,7 +49,7 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/progressmanager/progressmanagerinterface.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actionmanagerinterface.h>
#include <qtconcurrent/QtConcurrentTools>
using namespace QuickOpen;
......
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