summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2010-06-28 14:30:03 +0200
committerhjk <qtc-committer@nokia.com>2010-06-28 14:30:03 +0200
commitf56dacc76f3eafa9d088f6acd3f05843a04693b9 (patch)
tree36db88f2d2f7ce5535dffb38b254d1b36f659c0d
parent060385b41c990a4c846214a4b3c1b944c0a4f714 (diff)
downloadqt-creator-f56dacc76f3eafa9d088f6acd3f05843a04693b9.tar.gz
Core::Context: remove special handling of C_GLOBAL_ID/C_GLOBAL
-rw-r--r--src/plugins/bookmarks/bookmarksplugin.cpp2
-rw-r--r--src/plugins/coreplugin/actionmanager/actionmanager.cpp2
-rw-r--r--src/plugins/coreplugin/coreconstants.h1
-rw-r--r--src/plugins/coreplugin/dialogs/shortcutsettings.cpp6
-rw-r--r--src/plugins/coreplugin/icontext.h1
-rw-r--r--src/plugins/coreplugin/mainwindow.cpp67
-rw-r--r--src/plugins/coreplugin/mainwindow.h1
-rw-r--r--src/plugins/coreplugin/modemanager.cpp2
-rw-r--r--src/plugins/coreplugin/outputpane.cpp4
-rw-r--r--src/plugins/coreplugin/uniqueidmanager.cpp1
-rw-r--r--src/plugins/cppeditor/cppplugin.cpp2
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp2
-rw-r--r--src/plugins/debugger/debuggeruiswitcher.cpp11
-rw-r--r--src/plugins/fakevim/fakevimplugin.cpp2
-rw-r--r--src/plugins/find/findplugin.cpp4
-rw-r--r--src/plugins/find/findtoolbar.cpp2
-rw-r--r--src/plugins/help/helpplugin.cpp2
-rw-r--r--src/plugins/locator/locatorplugin.cpp2
-rw-r--r--src/plugins/perforce/perforceplugin.cpp2
-rw-r--r--src/plugins/projectexplorer/outputwindow.cpp2
-rw-r--r--src/plugins/projectexplorer/projectexplorer.cpp2
-rw-r--r--src/plugins/qt4projectmanager/qt-maemo/qemuruntimemanager.cpp2
22 files changed, 59 insertions, 63 deletions
diff --git a/src/plugins/bookmarks/bookmarksplugin.cpp b/src/plugins/bookmarks/bookmarksplugin.cpp
index 915242f9d6..f889ae2b81 100644
--- a/src/plugins/bookmarks/bookmarksplugin.cpp
+++ b/src/plugins/bookmarks/bookmarksplugin.cpp
@@ -69,7 +69,7 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
Core::ICore *core = Core::ICore::instance();
Core::ActionManager *am = core->actionManager();
Core::Context textcontext(TextEditor::Constants::C_TEXTEDITOR);
- Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
+ Core::Context globalcontext(Core::Constants::C_GLOBAL);
Core::ActionContainer *mtools =
am->actionContainer(Core::Constants::M_TOOLS);
diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.cpp b/src/plugins/coreplugin/actionmanager/actionmanager.cpp
index 48a506a66d..990dfda360 100644
--- a/src/plugins/coreplugin/actionmanager/actionmanager.cpp
+++ b/src/plugins/coreplugin/actionmanager/actionmanager.cpp
@@ -97,7 +97,7 @@ namespace {
QAction *myAction = new QAction(tr("My Action"), this);
Core::Command *cmd = am->registerAction(myAction,
"myplugin.myaction",
- QList<int>() << C_GLOBAL_ID);
+ Core::Context(C_GLOBAL));
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+u")));
connect(myAction, SIGNAL(triggered()), this, SLOT(performMyAction()));
\endcode
diff --git a/src/plugins/coreplugin/coreconstants.h b/src/plugins/coreplugin/coreconstants.h
index 5e6dfec7c6..f52aab9432 100644
--- a/src/plugins/coreplugin/coreconstants.h
+++ b/src/plugins/coreplugin/coreconstants.h
@@ -93,7 +93,6 @@ const char * const M_HELP = "QtCreator.Menu.Help";
//contexts
const char * const C_GLOBAL = "Global Context";
-const int C_GLOBAL_ID = 0;
const char * const C_WELCOME_MODE = "Core.WelcomeMode";
const char * const C_EDIT_MODE = "Core.EditMode";
const char * const C_DESIGN_MODE = "Core.DesignMode";
diff --git a/src/plugins/coreplugin/dialogs/shortcutsettings.cpp b/src/plugins/coreplugin/dialogs/shortcutsettings.cpp
index 7e14ddcfd6..59b5b2e8fe 100644
--- a/src/plugins/coreplugin/dialogs/shortcutsettings.cpp
+++ b/src/plugins/coreplugin/dialogs/shortcutsettings.cpp
@@ -386,6 +386,8 @@ void ShortcutSettings::markPossibleCollisions(ShortcutItem *item)
if (item->m_key.isEmpty())
return;
+ int globalId = Context(Constants::C_GLOBAL).at(0);
+
foreach (ShortcutItem *currentItem, m_scitems) {
if (currentItem->m_key.isEmpty() || item == currentItem ||
@@ -398,9 +400,9 @@ void ShortcutSettings::markPossibleCollisions(ShortcutItem *item)
// conflict if context is identical, OR if one
// of the contexts is the global context
if (item->m_cmd->context().contains(context) ||
- (item->m_cmd->context().contains(Constants::C_GLOBAL_ID) &&
+ (item->m_cmd->context().contains(globalId) &&
!currentItem->m_cmd->context().isEmpty()) ||
- (currentItem->m_cmd->context().contains(Constants::C_GLOBAL_ID) &&
+ (currentItem->m_cmd->context().contains(globalId) &&
!item->m_cmd->context().isEmpty())) {
currentItem->m_item->setForeground(2, Qt::red);
item->m_item->setForeground(2, Qt::red);
diff --git a/src/plugins/coreplugin/icontext.h b/src/plugins/coreplugin/icontext.h
index 7c18f0ed81..be67028fbd 100644
--- a/src/plugins/coreplugin/icontext.h
+++ b/src/plugins/coreplugin/icontext.h
@@ -46,7 +46,6 @@ class CORE_EXPORT Context
public:
Context() {}
- explicit Context(int c1) { d.append(c1); } // For C_GLOBAL_ID. FIXME: Sanitize.
explicit Context(const char *c1) { add(c1); }
Context(const char *c1, const char *c2) { add(c1); add(c2); }
Context(const char *c1, const char *c2, const char *c3) { add(c1); add(c2); add(c3); }
diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp
index 6b86341cf7..87615fd513 100644
--- a/src/plugins/coreplugin/mainwindow.cpp
+++ b/src/plugins/coreplugin/mainwindow.cpp
@@ -112,8 +112,7 @@ MainWindow::MainWindow() :
EventFilteringMainWindow(),
m_coreImpl(new CoreImpl(this)),
m_uniqueIDManager(new UniqueIDManager()),
- m_globalContext(Constants::C_GLOBAL_ID),
- m_additionalContexts(m_globalContext),
+ m_additionalContexts(Constants::C_GLOBAL),
// keep this in sync with main() in app/main.cpp
m_settings(new QSettings(QSettings::IniFormat, QSettings::UserScope,
QLatin1String("Nokia"), QLatin1String("QtCreator"), this)),
@@ -510,48 +509,50 @@ void MainWindow::registerDefaultActions()
ActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW);
ActionContainer *mhelp = am->actionContainer(Constants::M_HELP);
+ Context globalContext(Constants::C_GLOBAL);
+
// File menu separators
- Command *cmd = createSeparator(am, this, QLatin1String("QtCreator.File.Sep.Save"), m_globalContext);
+ Command *cmd = createSeparator(am, this, QLatin1String("QtCreator.File.Sep.Save"), globalContext);
mfile->addAction(cmd, Constants::G_FILE_SAVE);
- cmd = createSeparator(am, this, QLatin1String("QtCreator.File.Sep.Print"), m_globalContext);
+ cmd = createSeparator(am, this, QLatin1String("QtCreator.File.Sep.Print"), globalContext);
QIcon icon = QIcon::fromTheme(QLatin1String("edit-cut"), QIcon(Constants::ICON_CUT));
mfile->addAction(cmd, Constants::G_FILE_PRINT);
- cmd = createSeparator(am, this, QLatin1String("QtCreator.File.Sep.Close"), m_globalContext);
+ cmd = createSeparator(am, this, QLatin1String("QtCreator.File.Sep.Close"), globalContext);
mfile->addAction(cmd, Constants::G_FILE_CLOSE);
- cmd = createSeparator(am, this, QLatin1String("QtCreator.File.Sep.Other"), m_globalContext);
+ cmd = createSeparator(am, this, QLatin1String("QtCreator.File.Sep.Other"), globalContext);
mfile->addAction(cmd, Constants::G_FILE_OTHER);
// Edit menu separators
- cmd = createSeparator(am, this, QLatin1String("QtCreator.Edit.Sep.CopyPaste"), m_globalContext);
+ cmd = createSeparator(am, this, QLatin1String("QtCreator.Edit.Sep.CopyPaste"), globalContext);
medit->addAction(cmd, Constants::G_EDIT_COPYPASTE);
- cmd = createSeparator(am, this, QLatin1String("QtCreator.Edit.Sep.SelectAll"), m_globalContext);
+ cmd = createSeparator(am, this, QLatin1String("QtCreator.Edit.Sep.SelectAll"), globalContext);
medit->addAction(cmd, Constants::G_EDIT_SELECTALL);
- cmd = createSeparator(am, this, QLatin1String("QtCreator.Edit.Sep.Find"), m_globalContext);
+ cmd = createSeparator(am, this, QLatin1String("QtCreator.Edit.Sep.Find"), globalContext);
medit->addAction(cmd, Constants::G_EDIT_FIND);
- cmd = createSeparator(am, this, QLatin1String("QtCreator.Edit.Sep.Advanced"), m_globalContext);
+ cmd = createSeparator(am, this, QLatin1String("QtCreator.Edit.Sep.Advanced"), globalContext);
medit->addAction(cmd, Constants::G_EDIT_ADVANCED);
// Tools menu separators
- cmd = createSeparator(am, this, QLatin1String("QtCreator.Tools.Sep.Options"), m_globalContext);
+ cmd = createSeparator(am, this, QLatin1String("QtCreator.Tools.Sep.Options"), globalContext);
mtools->addAction(cmd, Constants::G_DEFAULT_THREE);
// Return to editor shortcut: Note this requires Qt to fix up
// handling of shortcut overrides in menus, item views, combos....
m_focusToEditor = new QShortcut(this);
- cmd = am->registerShortcut(m_focusToEditor, Constants::S_RETURNTOEDITOR, m_globalContext);
+ cmd = am->registerShortcut(m_focusToEditor, Constants::S_RETURNTOEDITOR, globalContext);
cmd->setDefaultKeySequence(QKeySequence(Qt::Key_Escape));
connect(m_focusToEditor, SIGNAL(activated()), this, SLOT(setFocusToEditor()));
// New File Action
icon = QIcon::fromTheme(QLatin1String("document-new"), QIcon(Constants::ICON_NEWFILE));
m_newAction = new QAction(icon, tr("&New File or Project..."), this);
- cmd = am->registerAction(m_newAction, Constants::NEW, m_globalContext);
+ cmd = am->registerAction(m_newAction, Constants::NEW, globalContext);
cmd->setDefaultKeySequence(QKeySequence::New);
mfile->addAction(cmd, Constants::G_FILE_NEW);
connect(m_newAction, SIGNAL(triggered()), this, SLOT(newFile()));
@@ -559,14 +560,14 @@ void MainWindow::registerDefaultActions()
// Open Action
icon = QIcon::fromTheme(QLatin1String("document-open"), QIcon(Constants::ICON_OPENFILE));
m_openAction = new QAction(icon, tr("&Open File or Project..."), this);
- cmd = am->registerAction(m_openAction, Constants::OPEN, m_globalContext);
+ cmd = am->registerAction(m_openAction, Constants::OPEN, globalContext);
cmd->setDefaultKeySequence(QKeySequence::Open);
mfile->addAction(cmd, Constants::G_FILE_OPEN);
connect(m_openAction, SIGNAL(triggered()), this, SLOT(openFile()));
// Open With Action
m_openWithAction = new QAction(tr("Open File &With..."), this);
- cmd = am->registerAction(m_openWithAction, Constants::OPEN_WITH, m_globalContext);
+ cmd = am->registerAction(m_openWithAction, Constants::OPEN_WITH, globalContext);
mfile->addAction(cmd, Constants::G_FILE_OPEN);
connect(m_openWithAction, SIGNAL(triggered()), this, SLOT(openFileWith()));
@@ -578,7 +579,7 @@ void MainWindow::registerDefaultActions()
// Save Action
icon = QIcon::fromTheme(QLatin1String("document-save"), QIcon(Constants::ICON_SAVEFILE));
QAction *tmpaction = new QAction(icon, tr("&Save"), this);
- cmd = am->registerAction(tmpaction, Constants::SAVE, m_globalContext);
+ cmd = am->registerAction(tmpaction, Constants::SAVE, globalContext);
cmd->setDefaultKeySequence(QKeySequence::Save);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDefaultText(tr("&Save"));
@@ -587,7 +588,7 @@ void MainWindow::registerDefaultActions()
// Save As Action
icon = QIcon::fromTheme(QLatin1String("document-save-as"));
tmpaction = new QAction(icon, tr("Save &As..."), this);
- cmd = am->registerAction(tmpaction, Constants::SAVEAS, m_globalContext);
+ cmd = am->registerAction(tmpaction, Constants::SAVEAS, globalContext);
#ifdef Q_WS_MAC
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+S")));
#endif
@@ -597,7 +598,7 @@ void MainWindow::registerDefaultActions()
// SaveAll Action
m_saveAllAction = new QAction(tr("Save A&ll"), this);
- cmd = am->registerAction(m_saveAllAction, Constants::SAVEALL, m_globalContext);
+ cmd = am->registerAction(m_saveAllAction, Constants::SAVEALL, globalContext);
#ifndef Q_WS_MAC
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+S")));
#endif
@@ -607,14 +608,14 @@ void MainWindow::registerDefaultActions()
// Print Action
icon = QIcon::fromTheme(QLatin1String("document-print"));
tmpaction = new QAction(icon, tr("&Print..."), this);
- cmd = am->registerAction(tmpaction, Constants::PRINT, m_globalContext);
+ cmd = am->registerAction(tmpaction, Constants::PRINT, globalContext);
cmd->setDefaultKeySequence(QKeySequence::Print);
mfile->addAction(cmd, Constants::G_FILE_PRINT);
// Exit Action
icon = QIcon::fromTheme(QLatin1String("application-exit"));
m_exitAction = new QAction(icon, tr("E&xit"), this);
- cmd = am->registerAction(m_exitAction, Constants::EXIT, m_globalContext);
+ cmd = am->registerAction(m_exitAction, Constants::EXIT, globalContext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Q")));
mfile->addAction(cmd, Constants::G_FILE_OTHER);
connect(m_exitAction, SIGNAL(triggered()), this, SLOT(exit()));
@@ -622,7 +623,7 @@ void MainWindow::registerDefaultActions()
// Undo Action
icon = QIcon::fromTheme(QLatin1String("edit-undo"), QIcon(Constants::ICON_UNDO));
tmpaction = new QAction(icon, tr("&Undo"), this);
- cmd = am->registerAction(tmpaction, Constants::UNDO, m_globalContext);
+ cmd = am->registerAction(tmpaction, Constants::UNDO, globalContext);
cmd->setDefaultKeySequence(QKeySequence::Undo);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDefaultText(tr("&Undo"));
@@ -632,7 +633,7 @@ void MainWindow::registerDefaultActions()
// Redo Action
icon = QIcon::fromTheme(QLatin1String("edit-redo"), QIcon(Constants::ICON_REDO));
tmpaction = new QAction(icon, tr("&Redo"), this);
- cmd = am->registerAction(tmpaction, Constants::REDO, m_globalContext);
+ cmd = am->registerAction(tmpaction, Constants::REDO, globalContext);
cmd->setDefaultKeySequence(QKeySequence::Redo);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDefaultText(tr("&Redo"));
@@ -642,7 +643,7 @@ void MainWindow::registerDefaultActions()
// Cut Action
icon = QIcon::fromTheme(QLatin1String("edit-cut"), QIcon(Constants::ICON_CUT));
tmpaction = new QAction(icon, tr("Cu&t"), this);
- cmd = am->registerAction(tmpaction, Constants::CUT, m_globalContext);
+ cmd = am->registerAction(tmpaction, Constants::CUT, globalContext);
cmd->setDefaultKeySequence(QKeySequence::Cut);
medit->addAction(cmd, Constants::G_EDIT_COPYPASTE);
tmpaction->setEnabled(false);
@@ -650,7 +651,7 @@ void MainWindow::registerDefaultActions()
// Copy Action
icon = QIcon::fromTheme(QLatin1String("edit-copy"), QIcon(Constants::ICON_COPY));
tmpaction = new QAction(icon, tr("&Copy"), this);
- cmd = am->registerAction(tmpaction, Constants::COPY, m_globalContext);
+ cmd = am->registerAction(tmpaction, Constants::COPY, globalContext);
cmd->setDefaultKeySequence(QKeySequence::Copy);
medit->addAction(cmd, Constants::G_EDIT_COPYPASTE);
tmpaction->setEnabled(false);
@@ -658,7 +659,7 @@ void MainWindow::registerDefaultActions()
// Paste Action
icon = QIcon::fromTheme(QLatin1String("edit-paste"), QIcon(Constants::ICON_PASTE));
tmpaction = new QAction(icon, tr("&Paste"), this);
- cmd = am->registerAction(tmpaction, Constants::PASTE, m_globalContext);
+ cmd = am->registerAction(tmpaction, Constants::PASTE, globalContext);
cmd->setDefaultKeySequence(QKeySequence::Paste);
medit->addAction(cmd, Constants::G_EDIT_COPYPASTE);
tmpaction->setEnabled(false);
@@ -666,7 +667,7 @@ void MainWindow::registerDefaultActions()
// Select All
icon = QIcon::fromTheme(QLatin1String("edit-select-all"));
tmpaction = new QAction(icon, tr("&Select All"), this);
- cmd = am->registerAction(tmpaction, Constants::SELECTALL, m_globalContext);
+ cmd = am->registerAction(tmpaction, Constants::SELECTALL, globalContext);
cmd->setDefaultKeySequence(QKeySequence::SelectAll);
medit->addAction(cmd, Constants::G_EDIT_SELECTALL);
tmpaction->setEnabled(false);
@@ -674,14 +675,14 @@ void MainWindow::registerDefaultActions()
// Goto Action
icon = QIcon::fromTheme(QLatin1String("go-jump"));
tmpaction = new QAction(icon, tr("&Go To Line..."), this);
- cmd = am->registerAction(tmpaction, Constants::GOTO, m_globalContext);
+ cmd = am->registerAction(tmpaction, Constants::GOTO, globalContext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+L")));
medit->addAction(cmd, Constants::G_EDIT_OTHER);
tmpaction->setEnabled(false);
// Options Action
m_optionsAction = new QAction(tr("&Options..."), this);
- cmd = am->registerAction(m_optionsAction, Constants::OPTIONS, m_globalContext);
+ cmd = am->registerAction(m_optionsAction, Constants::OPTIONS, globalContext);
#ifdef Q_WS_MAC
cmd->setDefaultKeySequence(QKeySequence("Ctrl+,"));
cmd->action()->setMenuRole(QAction::PreferencesRole);
@@ -712,7 +713,7 @@ void MainWindow::registerDefaultActions()
m_toggleSideBarAction = new QAction(QIcon(Constants::ICON_TOGGLE_SIDEBAR),
tr("Show Sidebar"), this);
m_toggleSideBarAction->setCheckable(true);
- cmd = am->registerAction(m_toggleSideBarAction, Constants::TOGGLE_SIDEBAR, m_globalContext);
+ cmd = am->registerAction(m_toggleSideBarAction, Constants::TOGGLE_SIDEBAR, globalContext);
cmd->setAttribute(Command::CA_UpdateText);
#ifdef Q_WS_MAC
cmd->setDefaultKeySequence(QKeySequence("Ctrl+0"));
@@ -728,7 +729,7 @@ void MainWindow::registerDefaultActions()
// Full Screen Action
m_toggleFullScreenAction = new QAction(tr("Full Screen"), this);
m_toggleFullScreenAction->setCheckable(true);
- cmd = am->registerAction(m_toggleFullScreenAction, Constants::TOGGLE_FULLSCREEN, m_globalContext);
+ cmd = am->registerAction(m_toggleFullScreenAction, Constants::TOGGLE_FULLSCREEN, globalContext);
cmd->setDefaultKeySequence(QKeySequence("Ctrl+Shift+F11"));
mwindow->addAction(cmd, Constants::G_WINDOW_SIZE);
connect(m_toggleFullScreenAction, SIGNAL(triggered(bool)), this, SLOT(setFullScreen(bool)));
@@ -746,7 +747,7 @@ void MainWindow::registerDefaultActions()
#else
tmpaction = new QAction(icon, tr("About &Qt Creator..."), this);
#endif
- cmd = am->registerAction(tmpaction, Constants::ABOUT_QTCREATOR, m_globalContext);
+ cmd = am->registerAction(tmpaction, Constants::ABOUT_QTCREATOR, globalContext);
mhelp->addAction(cmd, Constants::G_HELP_ABOUT);
tmpaction->setEnabled(true);
#ifdef Q_WS_MAC
@@ -756,7 +757,7 @@ void MainWindow::registerDefaultActions()
//About Plugins Action
tmpaction = new QAction(tr("About &Plugins..."), this);
- cmd = am->registerAction(tmpaction, Constants::ABOUT_PLUGINS, m_globalContext);
+ cmd = am->registerAction(tmpaction, Constants::ABOUT_PLUGINS, globalContext);
mhelp->addAction(cmd, Constants::G_HELP_ABOUT);
tmpaction->setEnabled(true);
#ifdef Q_WS_MAC
@@ -773,7 +774,7 @@ void MainWindow::registerDefaultActions()
#ifndef Q_WS_MAC // doesn't have the "About" actions in the Help menu
tmpaction = new QAction(this);
tmpaction->setSeparator(true);
- cmd = am->registerAction(tmpaction, QLatin1String("QtCreator.Help.Sep.About"), m_globalContext);
+ cmd = am->registerAction(tmpaction, QLatin1String("QtCreator.Help.Sep.About"), globalContext);
mhelp->addAction(cmd, Constants::G_HELP_ABOUT);
#endif
}
diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h
index 43c5d625b1..5c3e449fa8 100644
--- a/src/plugins/coreplugin/mainwindow.h
+++ b/src/plugins/coreplugin/mainwindow.h
@@ -179,7 +179,6 @@ private:
CoreImpl *m_coreImpl;
UniqueIDManager *m_uniqueIDManager;
- Context m_globalContext;
Context m_additionalContexts;
QSettings *m_settings;
QSettings *m_globalSettings;
diff --git a/src/plugins/coreplugin/modemanager.cpp b/src/plugins/coreplugin/modemanager.cpp
index 00edf5e083..091bcff4f4 100644
--- a/src/plugins/coreplugin/modemanager.cpp
+++ b/src/plugins/coreplugin/modemanager.cpp
@@ -179,7 +179,7 @@ void ModeManager::objectAdded(QObject *obj)
const QString shortcutId = QLatin1String("QtCreator.Mode.") + mode->id();
QShortcut *shortcut = new QShortcut(d->m_mainWindow);
shortcut->setWhatsThis(tr("Switch to <b>%1</b> mode").arg(mode->displayName()));
- Command *cmd = am->registerShortcut(shortcut, shortcutId, Context(Constants::C_GLOBAL_ID));
+ Command *cmd = am->registerShortcut(shortcut, shortcutId, Context(Constants::C_GLOBAL));
d->m_modeShortcuts.insert(index, cmd);
connect(cmd, SIGNAL(keySequenceChanged()), this, SLOT(updateModeToolTip()));
diff --git a/src/plugins/coreplugin/outputpane.cpp b/src/plugins/coreplugin/outputpane.cpp
index 42877e108e..5511b9be1e 100644
--- a/src/plugins/coreplugin/outputpane.cpp
+++ b/src/plugins/coreplugin/outputpane.cpp
@@ -282,7 +282,7 @@ void OutputPaneManager::init()
{
ActionManager *am = Core::ICore::instance()->actionManager();
ActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW);
- Context globalcontext = Context(Core::Constants::C_GLOBAL_ID);
+ const Context globalcontext(Core::Constants::C_GLOBAL);
// Window->Output Panes
ActionContainer *mpanes = am->createMenu(Constants::M_WINDOW_PANES);
@@ -356,7 +356,7 @@ void OutputPaneManager::init()
actionId.remove(QLatin1Char(' '));
QAction *action = new QAction(outPane->displayName(), this);
- Command *cmd = am->registerAction(action, actionId, Context(Constants::C_GLOBAL_ID));
+ Command *cmd = am->registerAction(action, actionId, Context(Constants::C_GLOBAL));
mpanes->addAction(cmd, "Coreplugin.OutputPane.PanesGroup");
m_actions.insert(cmd->action(), idx);
diff --git a/src/plugins/coreplugin/uniqueidmanager.cpp b/src/plugins/coreplugin/uniqueidmanager.cpp
index 7d8bd72736..f2dee8ff71 100644
--- a/src/plugins/coreplugin/uniqueidmanager.cpp
+++ b/src/plugins/coreplugin/uniqueidmanager.cpp
@@ -37,7 +37,6 @@ UniqueIDManager *UniqueIDManager::m_instance = 0;
UniqueIDManager::UniqueIDManager()
{
m_instance = this;
- m_uniqueIdentifiers.insert(Constants::C_GLOBAL, Constants::C_GLOBAL_ID);
}
UniqueIDManager::~UniqueIDManager()
diff --git a/src/plugins/cppeditor/cppplugin.cpp b/src/plugins/cppeditor/cppplugin.cpp
index 80daa5b0ea..acf3142b51 100644
--- a/src/plugins/cppeditor/cppplugin.cpp
+++ b/src/plugins/cppeditor/cppplugin.cpp
@@ -272,7 +272,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
cppToolsMenu->addAction(cmd);
// Update context in global context
- Core::Context globalContext(Core::Constants::C_GLOBAL_ID);
+ Core::Context globalContext(Core::Constants::C_GLOBAL);
cppToolsMenu->addAction(createSeparator(am, this, globalContext, CppEditor::Constants::SEPARATOR2));
m_updateCodeModelAction = new QAction(tr("Update Code Model"), this);
cmd = am->registerAction(m_updateCodeModelAction, QLatin1String(Constants::UPDATE_CODEMODEL), globalContext);
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index b527bbbcd8..4b44d16adc 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -982,7 +982,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
Core::ActionManager *am = core->actionManager();
QTC_ASSERT(am, return false);
- const Core::Context globalcontext(CC::C_GLOBAL_ID);
+ const Core::Context globalcontext(CC::C_GLOBAL);
const Core::Context cppDebuggercontext(C_CPPDEBUGGER);
const Core::Context cppeditorcontext(CppEditor::Constants::C_CPPEDITOR);
diff --git a/src/plugins/debugger/debuggeruiswitcher.cpp b/src/plugins/debugger/debuggeruiswitcher.cpp
index d0b2d00da8..1e9a89ae19 100644
--- a/src/plugins/debugger/debuggeruiswitcher.cpp
+++ b/src/plugins/debugger/debuggeruiswitcher.cpp
@@ -85,9 +85,6 @@ struct DebuggerUISwitcherPrivate
QStackedWidget *m_toolbarStack;
Internal::DebuggerMainWindow *m_mainWindow;
- // global context
- Core::Context m_globalContext;
-
QHash<int, Core::Context> m_contextsForLanguage;
QActionGroup *m_languageActionGroup;
@@ -139,8 +136,6 @@ DebuggerUISwitcher::DebuggerUISwitcher(Core::BaseMode *mode, QObject* parent) :
d->m_languageActionGroup->setExclusive(true);
- d->m_globalContext.add(Core::Constants::C_GLOBAL_ID);
-
DebuggerUISwitcherPrivate::m_instance = this;
}
@@ -212,7 +207,7 @@ void DebuggerUISwitcher::createViewsMenuItems()
{
Core::ICore *core = Core::ICore::instance();
Core::ActionManager *am = core->actionManager();
- Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
+ Core::Context globalcontext(Core::Constants::C_GLOBAL);
QMenu *mLang = d->m_languageMenu->menu();
mLang->setTitle(tr("&Languages"));
@@ -248,10 +243,12 @@ void DebuggerUISwitcher::addLanguage(const QString &langName, const Core::Contex
d->m_languageActionGroup->addAction(langChange);
+
QString prefix = tr("Alt+L");
connect(langChange, SIGNAL(triggered()), SLOT(langChangeTriggered()));
Core::Command *cmd = am->registerAction(langChange,
- "Debugger.Language." + langName, d->m_globalContext);
+ "Debugger.Language." + langName,
+ Core::Context(Core::Constants::C_GLOBAL));
cmd->setDefaultKeySequence(QKeySequence(
QString("%1,%2").arg(prefix).arg(d->m_languages.count())));
diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp
index 41a6188578..0ecdcdc4fa 100644
--- a/src/plugins/fakevim/fakevimplugin.cpp
+++ b/src/plugins/fakevim/fakevimplugin.cpp
@@ -587,7 +587,7 @@ bool FakeVimPluginPrivate::initialize()
Core::ActionManager *actionManager = Core::ICore::instance()->actionManager();
QTC_ASSERT(actionManager, return false);
- Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
+ Core::Context globalcontext(Core::Constants::C_GLOBAL);
m_fakeVimOptionsPage = new FakeVimOptionPage;
q->addObject(m_fakeVimOptionsPage);
diff --git a/src/plugins/find/findplugin.cpp b/src/plugins/find/findplugin.cpp
index 3f2c51263e..f5d22a9128 100644
--- a/src/plugins/find/findplugin.cpp
+++ b/src/plugins/find/findplugin.cpp
@@ -192,7 +192,7 @@ void FindPlugin::setupMenu()
mfind->appendGroup(Constants::G_FIND_FILTERS);
mfind->appendGroup(Constants::G_FIND_FLAGS);
mfind->appendGroup(Constants::G_FIND_ACTIONS);
- Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
+ Core::Context globalcontext(Core::Constants::C_GLOBAL);
Core::Command *cmd;
QAction *separator;
separator = new QAction(this);
@@ -220,7 +220,7 @@ void FindPlugin::setupFilterMenuItems()
QList<IFindFilter*> findInterfaces =
ExtensionSystem::PluginManager::instance()->getObjects<IFindFilter>();
Core::Command *cmd;
- Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
+ Core::Context globalcontext(Core::Constants::C_GLOBAL);
Core::ActionContainer *mfindadvanced = am->actionContainer(Constants::M_FIND_ADVANCED);
d->m_filterActions.clear();
diff --git a/src/plugins/find/findtoolbar.cpp b/src/plugins/find/findtoolbar.cpp
index baca9e7e3c..2aad64b1ab 100644
--- a/src/plugins/find/findtoolbar.cpp
+++ b/src/plugins/find/findtoolbar.cpp
@@ -131,7 +131,7 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
QMetaTypeId<QStringList>::qt_metatype_id();
// register actions
- Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
+ Core::Context globalcontext(Core::Constants::C_GLOBAL);
Core::ActionManager *am = Core::ICore::instance()->actionManager();
Core::ActionContainer *mfind = am->actionContainer(Constants::M_FIND);
Core::Command *cmd;
diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp
index ef08eb662e..9e80d21eb8 100644
--- a/src/plugins/help/helpplugin.cpp
+++ b/src/plugins/help/helpplugin.cpp
@@ -119,7 +119,7 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
Q_UNUSED(arguments)
Q_UNUSED(error)
m_core = Core::ICore::instance();
- Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
+ Core::Context globalcontext(Core::Constants::C_GLOBAL);
Core::Context modecontext(Constants::C_MODE_HELP);
const QString &locale = qApp->property("qtc_locale").toString();
diff --git a/src/plugins/locator/locatorplugin.cpp b/src/plugins/locator/locatorplugin.cpp
index 63e2ccfb7f..b237a67b0e 100644
--- a/src/plugins/locator/locatorplugin.cpp
+++ b/src/plugins/locator/locatorplugin.cpp
@@ -111,7 +111,7 @@ bool LocatorPlugin::initialize(const QStringList &, QString *)
const QString actionId = QLatin1String("QtCreator.Locate");
QAction *action = new QAction(m_locatorWidget->windowIcon(), m_locatorWidget->windowTitle(), this);
- Core::Command *cmd = core->actionManager()->registerAction(action, actionId, Core::Context(Core::Constants::C_GLOBAL_ID));
+ Core::Command *cmd = core->actionManager()->registerAction(action, actionId, Core::Context(Core::Constants::C_GLOBAL));
cmd->setDefaultKeySequence(QKeySequence("Ctrl+K"));
connect(action, SIGNAL(triggered()), this, SLOT(openLocator()));
diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp
index 33762b3039..087ba8c962 100644
--- a/src/plugins/perforce/perforceplugin.cpp
+++ b/src/plugins/perforce/perforceplugin.cpp
@@ -266,7 +266,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
mtools->addMenu(mperforce);
m_menuAction = mperforce->menu()->menuAction();
- Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
+ Core::Context globalcontext(Core::Constants::C_GLOBAL);
Core::Context perforcesubmitcontext(Constants::PERFORCESUBMITEDITOR_CONTEXT);
Core::Command *command;
diff --git a/src/plugins/projectexplorer/outputwindow.cpp b/src/plugins/projectexplorer/outputwindow.cpp
index 4a64f5b67a..6083b28d48 100644
--- a/src/plugins/projectexplorer/outputwindow.cpp
+++ b/src/plugins/projectexplorer/outputwindow.cpp
@@ -82,7 +82,7 @@ OutputPane::OutputPane()
// Stop
Core::ActionManager *am = Core::ICore::instance()->actionManager();
- Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
+ Core::Context globalcontext(Core::Constants::C_GLOBAL);
m_stopAction = new QAction(QIcon(Constants::ICON_STOP), tr("Stop"), this);
m_stopAction->setToolTip(tr("Stop"));
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index 74d0b003ee..b5734a70fe 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -263,7 +263,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
d->m_proWindow = new ProjectWindow;
- Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
+ Core::Context globalcontext(Core::Constants::C_GLOBAL);
Core::Context pecontext(Constants::C_PROJECTEXPLORER);
d->m_projectsMode = new Core::BaseMode;
diff --git a/src/plugins/qt4projectmanager/qt-maemo/qemuruntimemanager.cpp b/src/plugins/qt4projectmanager/qt-maemo/qemuruntimemanager.cpp
index 2e02ec6a3e..3afa0095ec 100644
--- a/src/plugins/qt4projectmanager/qt-maemo/qemuruntimemanager.cpp
+++ b/src/plugins/qt4projectmanager/qt-maemo/qemuruntimemanager.cpp
@@ -85,7 +85,7 @@ QemuRuntimeManager::QemuRuntimeManager(QObject *parent)
Core::ICore *core = Core::ICore::instance();
Core::ActionManager *actionManager = core->actionManager();
Core::Command *qemuCommand = actionManager->registerAction(m_qemuAction,
- "MaemoEmulator", Core::Context(Core::Constants::C_GLOBAL_ID));
+ "MaemoEmulator", Core::Context(Core::Constants::C_GLOBAL));
qemuCommand->setAttribute(Core::Command::CA_UpdateText);
qemuCommand->setAttribute(Core::Command::CA_UpdateIcon);