Core::Context: compile hot fix for Windows.

This commit is contained in:
hjk
2010-06-25 17:37:59 +02:00
parent 2bdf10ce10
commit 2f5f358ff4
63 changed files with 199 additions and 260 deletions
+3 -6
View File
@@ -47,7 +47,6 @@
#include <coreplugin/icore.h>
#include <coreplugin/ifile.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/uniqueidmanager.h>
#include <extensionsystem/pluginmanager.h>
#include <find/ifindsupport.h>
#include <texteditor/fontsettings.h>
@@ -291,11 +290,10 @@ class BinEditorInterface : public Core::IEditor
public:
BinEditorInterface(BinEditor *editor)
{
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
m_editor = editor;
m_file = new BinEditorFile(m_editor);
m_context << uidm->uniqueIdentifier(Core::Constants::K_DEFAULT_BINARY_EDITOR_ID);
m_context << uidm->uniqueIdentifier(Constants::C_BINEDITOR);
m_context.add(Core::Constants::K_DEFAULT_BINARY_EDITOR_ID);
m_context.add(Constants::C_BINEDITOR);
m_cursorPositionLabel = new Utils::LineColumnLabel;
QHBoxLayout *l = new QHBoxLayout;
@@ -436,8 +434,7 @@ void BinEditorPlugin::initializeEditor(BinEditor *editor)
QObject::connect(editor, SIGNAL(modificationChanged(bool)), editorInterface, SIGNAL(changed()));
editor->setEditorInterface(editorInterface);
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
m_context << uidm->uniqueIdentifier(Constants::C_BINEDITOR);
m_context.add(Constants::C_BINEDITOR);
if (!m_undoAction) {
m_undoAction = registerNewAction(QLatin1String(Core::Constants::UNDO),
this, SLOT(undoAction()),
+3 -3
View File
@@ -36,7 +36,6 @@
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/uniqueidmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
#include <texteditor/basetexteditor.h>
@@ -298,9 +297,10 @@ void BookmarkView::gotoBookmark(const QModelIndex &index)
////
BookmarkContext::BookmarkContext(BookmarkView *widget)
: Core::IContext(widget), m_bookmarkView(widget)
: Core::IContext(widget),
m_bookmarkView(widget),
m_context(Constants::BOOKMARKS_CONTEXT)
{
m_context << UniqueIDManager::instance()->uniqueIdentifier(Constants::BOOKMARKS_CONTEXT);
}
Context BookmarkContext::context() const
+1 -1
View File
@@ -165,7 +165,7 @@ public:
virtual QWidget *widget();
private:
BookmarkView *m_bookmarkView;
Core::Context m_context;
const Core::Context m_context;
};
class BookmarkViewFactory : public Core::INavigationWidgetFactory
+1 -3
View File
@@ -35,7 +35,6 @@
#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
@@ -69,8 +68,7 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
{
Core::ICore *core = Core::ICore::instance();
Core::ActionManager *am = core->actionManager();
Core::UniqueIDManager *uidm = core->uniqueIDManager();
Core::Context textcontext(uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR));
Core::Context textcontext(TextEditor::Constants::C_TEXTEDITOR);
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
Core::ActionContainer *mtools =
@@ -33,7 +33,6 @@
#include "cmakeeditorfactory.h"
#include "cmakeprojectconstants.h"
#include <coreplugin/uniqueidmanager.h>
#include <texteditor/fontsettings.h>
#include <texteditor/texteditoractionhandler.h>
#include <texteditor/texteditorconstants.h>
@@ -49,12 +48,10 @@ using namespace CMakeProjectManager::Internal;
//
CMakeEditorEditable::CMakeEditorEditable(CMakeEditor *editor)
: BaseTextEditorEditable(editor)
{
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
m_context << uidm->uniqueIdentifier(CMakeProjectManager::Constants::C_CMAKEEDITOR);
m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
}
: BaseTextEditorEditable(editor),
m_context(CMakeProjectManager::Constants::C_CMAKEEDITOR,
TextEditor::Constants::C_TEXTEDITOR)
{ }
Core::Context CMakeEditorEditable::context() const
{
@@ -60,7 +60,7 @@ public:
QString id() const;
bool isTemporary() const { return false; }
private:
Core::Context m_context;
const Core::Context m_context;
};
class CMakeEditor : public TextEditor::BaseTextEditor
@@ -262,7 +262,7 @@ QList<ActionContainerPrivate *> ActionManagerPrivate::containers() const
bool ActionManagerPrivate::hasContext(int context) const
{
return m_context.contains(context);
return m_context.d.contains(context);
}
void ActionManagerPrivate::setContext(const Context &context)
@@ -278,8 +278,8 @@ void ActionManagerPrivate::setContext(const Context &context)
bool ActionManagerPrivate::hasContext(const Context &context) const
{
for (int i = 0; i < m_context.count(); ++i) {
if (context.contains(m_context.at(i)))
for (int i = 0; i < m_context.d.count(); ++i) {
if (context.d.contains(m_context.d.at(i)))
return true;
}
return false;
@@ -403,7 +403,7 @@ Command *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const QStri
shortcut->setParent(m_mainWnd);
sc->setShortcut(shortcut);
if (context.isEmpty())
if (context.d.isEmpty())
sc->setContext(Context(0));
else
sc->setContext(context);
@@ -336,8 +336,8 @@ QString Shortcut::defaultText() const
bool Shortcut::setCurrentContext(const Core::Context &context)
{
foreach (int ctxt, m_context) {
if (context.contains(ctxt)) {
foreach (int ctxt, m_context.d) {
if (context.d.contains(ctxt)) {
if (!m_shortcut->isEnabled()) {
m_shortcut->setEnabled(true);
emit activeStateChanged();
@@ -487,10 +487,10 @@ static inline QString msgActionWarning(QAction *newAction, int k, QAction *oldAc
void Action::addOverrideAction(QAction *action, const Core::Context &context)
{
if (context.isEmpty()) {
if (context.d.isEmpty()) {
m_contextActionMap.insert(0, action);
} else {
for (int i=0; i<context.size(); ++i) {
for (int i = 0; i < context.size(); ++i) {
int k = context.at(i);
if (m_contextActionMap.contains(k))
qWarning("%s", qPrintable(msgActionWarning(action, k, m_contextActionMap.value(k, 0))));
+2 -4
View File
@@ -31,7 +31,6 @@
#include <coreplugin/icore.h>
#include <coreplugin/modemanager.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/openeditorsmodel.h>
#include <coreplugin/actionmanager/actionmanager.h>
@@ -136,8 +135,7 @@ DesignMode::~DesignMode()
Context DesignMode::context() const
{
static Context contexts(
Core::UniqueIDManager::instance()->uniqueIdentifier(Constants::C_DESIGN_MODE));
static Context contexts(Constants::C_DESIGN_MODE);
return contexts;
}
@@ -269,7 +267,7 @@ void DesignMode::updateContext(Core::IMode *newMode, Core::IMode *oldMode)
void DesignMode::setActiveContext(const Context &context)
{
if (d->m_activeContext == context)
if (d->m_activeContext.d == context.d)
return;
if (ModeManager::instance()->currentMode() == this)
@@ -393,7 +393,7 @@ void ShortcutSettings::markPossibleCollisions(ShortcutItem *item)
continue;
}
foreach (int context, currentItem->m_cmd->context()) {
foreach (int context, currentItem->m_cmd->context().d) {
// conflict if context is identical, OR if one
// of the contexts is the global context
+3 -4
View File
@@ -117,10 +117,9 @@ QString EditMode::id() const
Context EditMode::context() const
{
static Context contexts(
UniqueIDManager::instance()->uniqueIdentifier(Constants::C_EDIT_MODE),
UniqueIDManager::instance()->uniqueIdentifier(Constants::C_EDITORMANAGER) ,
UniqueIDManager::instance()->uniqueIdentifier(Constants::C_NAVIGATION_PANE));
static Context contexts(Constants::C_EDIT_MODE,
Constants::C_EDITORMANAGER,
Constants::C_NAVIGATION_PANE);
return contexts;
}
@@ -43,7 +43,6 @@
#include <coreplugin/editortoolbar.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/modemanager.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
@@ -267,15 +266,9 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
connect(m_d->m_core, SIGNAL(contextAboutToChange(Core::IContext *)),
this, SLOT(handleContextChange(Core::IContext *)));
UniqueIDManager *uidm = m_d->m_core->uniqueIDManager();
const Context gc = Context(Constants::C_GLOBAL_ID);
const Context editManagerContext =
Context(uidm->uniqueIdentifier(Constants::C_EDITORMANAGER));
const Context editManagerContext(Constants::C_EDITORMANAGER);
// combined context for edit & design modes
const Context editDesignContext =
Context(uidm->uniqueIdentifier(Constants::C_EDITORMANAGER),
uidm->uniqueIdentifier(Constants::C_DESIGN_MODE));
const Context editDesignContext(Constants::C_EDITORMANAGER, Constants::C_DESIGN_MODE);
ActionManager *am = m_d->m_core->actionManager();
ActionContainer *mfile = am->actionContainer(Constants::M_FILE);
@@ -478,11 +471,7 @@ EditorManager::~EditorManager()
void EditorManager::init()
{
QList<int> context;
context << m_d->m_core->uniqueIDManager()->uniqueIdentifier("QtCreator.OpenDocumentsView");
m_d->m_coreListener = new EditorClosingCoreListener(this);
pluginManager()->addObject(m_d->m_coreListener);
m_d->m_openEditorsFactory = new OpenEditorsViewFactory();
+16 -4
View File
@@ -31,6 +31,8 @@
#define ICONTEXT_H
#include <coreplugin/core_global.h>
#include <QtCore/QList>
#include <QtCore/QObject>
QT_BEGIN_NAMESPACE
@@ -39,13 +41,23 @@ QT_END_NAMESPACE
namespace Core {
class CORE_EXPORT Context : public QList<int>
class CORE_EXPORT Context
{
public:
Context() {}
explicit Context(int c1) { append(c1); }
Context(int c1, int c2) { append(c1); append(c2); }
Context(int c1, int c2, int c3) { append(c1); append(c2); append(c3); }
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); }
Context(const char *base, int offset);
void add(const char *c);
bool contains(const char *c) const;
bool contains(int c) const { return d.contains(c); }
int size() const { return d.size(); }
bool isEmpty() const { return d.isEmpty(); }
int at(int i) const { return d.at(i); }
public:
QList<int> d;
};
class CORE_EXPORT IContext : public QObject
+12 -12
View File
@@ -1198,21 +1198,21 @@ void MainWindow::writeSettings()
void MainWindow::updateAdditionalContexts(const Context &remove, const Context &add)
{
foreach (const int context, remove) {
foreach (const int context, remove.d) {
if (context == 0)
continue;
int index = m_additionalContexts.indexOf(context);
int index = m_additionalContexts.d.indexOf(context);
if (index != -1)
m_additionalContexts.removeAt(index);
m_additionalContexts.d.removeAt(index);
}
foreach (const int context, add) {
foreach (const int context, add.d) {
if (context == 0)
continue;
if (!m_additionalContexts.contains(context))
m_additionalContexts.prepend(context);
if (!m_additionalContexts.d.contains(context))
m_additionalContexts.d.prepend(context);
}
updateContext();
@@ -1228,15 +1228,15 @@ void MainWindow::updateContext()
Context contexts;
if (m_activeContext)
contexts += m_activeContext->context();
contexts.d += m_activeContext->context().d;
contexts += m_additionalContexts;
contexts.d += m_additionalContexts.d;
Context uniquecontexts;
for (int i = 0; i < contexts.size(); ++i) {
const int c = contexts.at(i);
if (!uniquecontexts.contains(c))
uniquecontexts << c;
for (int i = 0; i < contexts.d.size(); ++i) {
const int c = contexts.d.at(i);
if (!uniquecontexts.d.contains(c))
uniquecontexts.d << c;
}
m_actionManager->setContext(uniquecontexts);
+1 -3
View File
@@ -34,7 +34,6 @@
#include "coreconstants.h"
#include "inavigationwidgetfactory.h"
#include "modemanager.h"
#include "uniqueidmanager.h"
#include "actionmanager/actionmanager.h"
#include "actionmanager/command.h"
@@ -348,8 +347,7 @@ void NavigationWidget::objectAdded(QObject * obj)
ICore *core = ICore::instance();
ActionManager *am = core->actionManager();
Context navicontext(core->uniqueIDManager()->
uniqueIdentifier(Core::Constants::C_NAVIGATION_PANE));
Context navicontext(Core::Constants::C_NAVIGATION_PANE);
QString id = factory->id();
QShortcut *shortcut = new QShortcut(this);
+25 -1
View File
@@ -32,7 +32,7 @@
using namespace Core;
UniqueIDManager* UniqueIDManager::m_instance = 0;
UniqueIDManager *UniqueIDManager::m_instance = 0;
UniqueIDManager::UniqueIDManager()
{
@@ -64,3 +64,27 @@ QString UniqueIDManager::stringForUniqueIdentifier(int uid)
{
return m_uniqueIdentifiers.key(uid);
}
// FIXME: Move to some better place.
#include "icontext.h"
static int toId(const char *id)
{
return UniqueIDManager::instance()->uniqueIdentifier(QLatin1String(id));
}
Context::Context(const char *id, int offset)
{
d.append(UniqueIDManager::instance()
-> uniqueIdentifier(QString(id) + QString::number(offset)));
}
void Context::add(const char *id)
{
d.append(toId(id));
}
bool Context::contains(const char *id) const
{
return d.contains(toId(id));
}
+1 -2
View File
@@ -47,7 +47,6 @@
#include <coreplugin/mimedatabase.h>
#include <coreplugin/icore.h>
#include <coreplugin/messagemanager.h>
#include <coreplugin/uniqueidmanager.h>
#include <utils/qtcassert.h>
#include <texteditor/basetexteditor.h>
@@ -83,7 +82,7 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m
Q_UNUSED(error_message)
// Create the globalcontext list to register actions accordingly
Core::Context globalcontext(UniqueIDManager::instance()->uniqueIdentifier(Core::Constants::C_GLOBAL));
Core::Context globalcontext(Core::Constants::C_GLOBAL);
// Create the settings Page
m_settings->fromSettings(Core::ICore::instance()->settings());
+3 -5
View File
@@ -61,7 +61,6 @@
#include <cpptools/cpptoolsconstants.h>
#include <coreplugin/icore.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/editormanager/ieditor.h>
@@ -588,10 +587,9 @@ struct FindCanonicalSymbol
CPPEditorEditable::CPPEditorEditable(CPPEditor *editor)
: BaseTextEditorEditable(editor)
{
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
m_context << uidm->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR);
m_context << uidm->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
m_context.add(CppEditor::Constants::C_CPPEDITOR);
m_context.add(ProjectExplorer::Constants::LANG_CXX);
m_context.add(TextEditor::Constants::C_TEXTEDITOR);
}
CPPEditor::CPPEditor(QWidget *parent)
+1 -1
View File
@@ -231,7 +231,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
wizardParameters.setId(QLatin1String("C.Header"));
addAutoReleasedObject(new CppFileWizard(wizardParameters, Header, core));
Core::Context context(core->uniqueIDManager()->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR));
Core::Context context(CppEditor::Constants::C_CPPEDITOR);
Core::ActionManager *am = core->actionManager();
Core::ActionContainer *contextMenu= am->createMenu(CppEditor::Constants::M_CONTEXT);
+7 -6
View File
@@ -50,7 +50,6 @@
# include <projectexplorer/projectexplorerconstants.h>
# include <projectexplorer/session.h>
# include <coreplugin/icore.h>
# include <coreplugin/uniqueidmanager.h>
# include <coreplugin/mimedatabase.h>
# include <coreplugin/editormanager/editormanager.h>
# include <coreplugin/progressmanager/progressmanager.h>
@@ -957,16 +956,18 @@ void CppModelManager::editorAboutToClose(Core::IEditor *editor)
bool CppModelManager::isCppEditor(Core::IEditor *editor) const
{
Core::UniqueIDManager *uidm = m_core->uniqueIDManager();
const int uid = uidm->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
return editor->context().contains(uid);
return editor->context().contains(ProjectExplorer::Constants::LANG_CXX);
}
TokenCache *CppModelManager::tokenCache(TextEditor::ITextEditor *editor) const
{ return editorSupport(editor)->tokenCache(); }
{
return editorSupport(editor)->tokenCache();
}
void CppModelManager::emitDocumentUpdated(Document::Ptr doc)
{ emit documentUpdated(doc); }
{
emit documentUpdated(doc);
}
void CppModelManager::onDocumentUpdated(Document::Ptr doc)
{
+1 -4
View File
@@ -43,7 +43,6 @@
#include <coreplugin/icore.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
@@ -80,7 +79,6 @@ enum { debug = 0 };
CppToolsPlugin *CppToolsPlugin::m_instance = 0;
CppToolsPlugin::CppToolsPlugin() :
m_context(-1),
m_modelManager(0),
m_fileSettings(new CppFileSettings)
{
@@ -131,8 +129,7 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
mtools->addMenu(mcpptools);
// Actions
m_context = core->uniqueIDManager()->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR);
Core::Context context(m_context);
Core::Context context(CppEditor::Constants::C_CPPEDITOR);
QAction *switchAction = new QAction(tr("Switch Header/Source"), this);
Core::Command *command = am->registerAction(switchAction, Constants::SWITCH_HEADER_SOURCE, context);
-1
View File
@@ -76,7 +76,6 @@ private:
QString correspondingHeaderOrSourceI(const QString &fileName) const;
QFileInfo findFile(const QDir &dir, const QString &name, const ProjectExplorer::Project *project) const;
int m_context;
CppModelManager *m_modelManager;
QSharedPointer<CppFileSettings> m_fileSettings;
+2 -4
View File
@@ -48,7 +48,6 @@
#include <coreplugin/filemanager.h>
#include <coreplugin/messagemanager.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
@@ -257,7 +256,7 @@ bool CVSPlugin::initialize(const QStringList & /*arguments */, QString *errorMes
toolsContainer->addMenu(cvsMenu);
m_menuAction = cvsMenu->menu()->menuAction();
Core::Context globalcontext(core->uniqueIDManager()->uniqueIdentifier(C_GLOBAL));
Core::Context globalcontext(C_GLOBAL);
Core::Command *command;
@@ -379,8 +378,7 @@ bool CVSPlugin::initialize(const QStringList & /*arguments */, QString *errorMes
m_commandLocator->appendCommand(command);
// Actions of the submit editor
Core::Context cvscommitcontext;
cvscommitcontext << Core::UniqueIDManager::instance()->uniqueIdentifier(Constants::CVSCOMMITEDITOR);
Core::Context cvscommitcontext(Constants::CVSCOMMITEDITOR);
m_submitCurrentLogAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
command = ami->registerAction(m_submitCurrentLogAction, Constants::SUBMIT_CURRENT, cvscommitcontext);
+5 -11
View File
@@ -82,7 +82,6 @@
#include <coreplugin/navigationwidget.h>
#include <coreplugin/outputpane.h>
#include <coreplugin/rightpane.h>
#include <coreplugin/uniqueidmanager.h>
#include <cplusplus/ExpressionUnderCursor.h>
#include <cplusplus/CppDocument.h>
@@ -980,15 +979,12 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
ICore *core = ICore::instance();
QTC_ASSERT(core, return false);
Core::UniqueIDManager *uidm = core->uniqueIDManager();
QTC_ASSERT(uidm, return false);
Core::ActionManager *am = core->actionManager();
QTC_ASSERT(am, return false);
const Core::Context globalcontext(CC::C_GLOBAL_ID);
const Core::Context cppDebuggercontext(uidm->uniqueIdentifier(C_CPPDEBUGGER));
const Core::Context cppeditorcontext(uidm->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR));
const Core::Context cppDebuggercontext(C_CPPDEBUGGER);
const Core::Context cppeditorcontext(CppEditor::Constants::C_CPPEDITOR);
m_stopIcon = QIcon(_(":/debugger/images/debugger_stop_small.png"));
m_stopIcon.addFile(":/debugger/images/debugger_stop.png");
@@ -1206,17 +1202,15 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
errorMessage->clear();
}
m_gdbRunningContext = Core::Context(uidm->uniqueIdentifier(Constants::GDBRUNNING));
m_gdbRunningContext = Core::Context(Constants::GDBRUNNING);
// Register factory of DebuggerRunControl.
m_debuggerRunControlFactory = new DebuggerRunControlFactory
(m_plugin, DebuggerEngineType(cmdLineEnabledEngines));
m_plugin->addAutoReleasedObject(m_debuggerRunControlFactory);
m_debugMode->setContext(Core::Context(
uidm->uniqueIdentifier(CC::C_EDITORMANAGER),
uidm->uniqueIdentifier(C_DEBUGMODE),
uidm->uniqueIdentifier(CC::C_NAVIGATION_PANE)));
m_debugMode->setContext(
Core::Context(CC::C_EDITORMANAGER, C_DEBUGMODE, CC::C_NAVIGATION_PANE));
m_reverseToolButton = 0;
+1 -2
View File
@@ -42,7 +42,6 @@
#include <coreplugin/modemanager.h>
#include <coreplugin/basemode.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/icore.h>
#include <coreplugin/editormanager/editormanager.h>
@@ -140,7 +139,7 @@ DebuggerUISwitcher::DebuggerUISwitcher(Core::BaseMode *mode, QObject* parent) :
d->m_languageActionGroup->setExclusive(true);
d->m_globalContext << Core::Constants::C_GLOBAL_ID;
d->m_globalContext.add(Core::Constants::C_GLOBAL_ID);
DebuggerUISwitcherPrivate::m_instance = this;
}
+2 -7
View File
@@ -46,7 +46,6 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/icore.h>
#include <coreplugin/helpmanager.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
@@ -174,8 +173,7 @@ FormEditorW::FormEditorW() :
m_fwm = qobject_cast<qdesigner_internal::QDesignerFormWindowManager*>(m_formeditor->formWindowManager());
QTC_ASSERT(m_fwm, return);
Core::UniqueIDManager *idMan = Core::UniqueIDManager::instance();
m_contexts << idMan->uniqueIdentifier(QLatin1String(Designer::Constants::C_FORMEDITOR));
m_contexts.add(Designer::Constants::C_FORMEDITOR);
setupActions();
@@ -331,11 +329,8 @@ void FormEditorW::fullInit()
layout->addWidget(m_editorWidget);
m_modeWidget->setLayout(layout);
Core::UniqueIDManager *idMan = Core::UniqueIDManager::instance();
int editorManagerContext = idMan->uniqueIdentifier(QLatin1String(Core::Constants::C_EDITORMANAGER));
Core::Context designerContexts = m_contexts;
designerContexts.append(Core::Context(editorManagerContext));
designerContexts.add(Core::Constants::C_EDITORMANAGER);
m_context = new DesignerContext(designerContexts, m_modeWidget, this);
m_core->addContextObject(m_context);
+2 -4
View File
@@ -38,7 +38,6 @@
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/mimedatabase.h>
#include <texteditor/basetextdocument.h>
#include <texteditor/plaintexteditor.h>
@@ -75,9 +74,8 @@ FormWindowEditor::FormWindowEditor(Internal::DesignerXmlEditor *editor,
Core::IEditor(parent),
d(new FormWindowEditorPrivate(editor, form))
{
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
d->m_context << uidm->uniqueIdentifier(QLatin1String(Designer::Constants::K_DESIGNER_XML_EDITOR_ID))
<< uidm->uniqueIdentifier(QLatin1String(Designer::Constants::C_DESIGNER_XML_EDITOR));
d->m_context.add(Designer::Constants::K_DESIGNER_XML_EDITOR_ID);
d->m_context.add(Designer::Constants::C_DESIGNER_XML_EDITOR);
connect(form, SIGNAL(changed()), this, SIGNAL(changed()));
// Revert to saved/load externally modified files
connect(&(d->m_file), SIGNAL(reload(QString)), this, SLOT(slotOpen(QString)));
@@ -31,7 +31,6 @@
#include "genericprojectmanager.h"
#include "genericprojectconstants.h"
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/editormanager/editormanager.h>
#include <texteditor/fontsettings.h>
#include <texteditor/texteditoractionhandler.h>
@@ -102,11 +101,9 @@ Core::IFile *ProjectFilesFactory::open(const QString &fileName)
////////////////////////////////////////////////////////////////////////////////////////
ProjectFilesEditable::ProjectFilesEditable(ProjectFilesEditor *editor)
: TextEditor::BaseTextEditorEditable(editor)
{
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
m_context << uidm->uniqueIdentifier(Constants::C_FILESEDITOR);
}
: TextEditor::BaseTextEditorEditable(editor),
m_context(Constants::C_FILESEDITOR)
{ }
ProjectFilesEditable::~ProjectFilesEditable()
{ }
+2 -5
View File
@@ -45,7 +45,6 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/filemanager.h>
#include <coreplugin/messagemanager.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
@@ -282,8 +281,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
m_core = Core::ICore::instance();
m_gitClient = new GitClient(this);
// Create the globalcontext list to register actions accordingly
Core::Context globalcontext;
globalcontext << m_core->uniqueIDManager()->uniqueIdentifier(Core::Constants::C_GLOBAL);
Core::Context globalcontext(Core::Constants::C_GLOBAL);
// Create the settings Page
addAutoReleasedObject(new SettingsPage());
@@ -493,8 +491,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
}
// Submit editor
Core::Context submitContext;
submitContext.push_back(m_core->uniqueIDManager()->uniqueIdentifier(QLatin1String(Constants::C_GITSUBMITEDITOR)));
Core::Context submitContext(Constants::C_GITSUBMITEDITOR);
m_submitCurrentAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
Core::Command *command = actionManager->registerAction(m_submitCurrentAction, Constants::SUBMIT_CURRENT, submitContext);
connect(m_submitCurrentAction, SIGNAL(triggered()), this, SLOT(submitCurrentLog()));
+5 -6
View File
@@ -59,7 +59,6 @@
#include <coreplugin/modemanager.h>
#include <coreplugin/rightpane.h>
#include <coreplugin/sidebar.h>
#include <coreplugin/uniqueidmanager.h>
#include <extensionsystem/pluginmanager.h>
#include <texteditor/texteditorconstants.h>
#include <utils/styledbar.h>
@@ -121,7 +120,7 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
Q_UNUSED(error)
m_core = Core::ICore::instance();
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
Core::Context modecontext(m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_MODE_HELP));
Core::Context modecontext(Constants::C_MODE_HELP);
const QString &locale = qApp->property("qtc_locale").toString();
if (!locale.isEmpty()) {
@@ -342,7 +341,7 @@ void HelpPlugin::setupUi()
{
// side bar widgets and shortcuts
Core::ActionManager *am = m_core->actionManager();
Core::Context modecontext(m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_MODE_HELP));
Core::Context modecontext(Constants::C_MODE_HELP);
IndexWindow *indexWindow = new IndexWindow();
indexWindow->setWindowTitle(tr(SB_INDEX));
@@ -520,12 +519,12 @@ void HelpPlugin::createRightPaneContextViewer()
Aggregation::Aggregate *agg = new Aggregation::Aggregate();
agg->add(m_helpViewerForSideBar);
agg->add(new HelpViewerFindSupport(m_helpViewerForSideBar));
m_core->addContextObject(new Core::BaseContext(m_helpViewerForSideBar,Core::Context(
m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_HELP_SIDEBAR)), this));
m_core->addContextObject(new Core::BaseContext(m_helpViewerForSideBar,
Core::Context(Constants::C_HELP_SIDEBAR), this));
QAction *copy = new QAction(this);
Core::Command *cmd = m_core->actionManager()->registerAction(copy, Core::Constants::COPY,
Core::Context(m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_HELP_SIDEBAR)));
Core::Context(Constants::C_HELP_SIDEBAR));
copy->setText(cmd->action()->text());
copy->setIcon(cmd->action()->icon());
+4 -3
View File
@@ -36,7 +36,6 @@
#include "ui_imageviewertoolbar.h"
#include <coreplugin/icore.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/command.h>
#include <utils/qtcassert.h>
@@ -51,6 +50,10 @@ namespace Internal {
struct ImageViewerPrivate
{
ImageViewerPrivate()
: context(Constants::IMAGEVIEWER_ID)
{}
Core::Context context;
QString displayName;
ImageViewerFile *file;
@@ -64,8 +67,6 @@ ImageViewer::ImageViewer(QWidget *parent)
d_ptr(new ImageViewerPrivate)
{
d_ptr->file = new ImageViewerFile(this);
d_ptr->context << Core::ICore::instance()->uniqueIDManager()
->uniqueIdentifier(Constants::IMAGEVIEWER_ID);
d_ptr->imageView = new ImageView();
@@ -38,7 +38,6 @@
#include <QtGui/QAction>
#include <coreplugin/icore.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/editormanager/editormanager.h>
@@ -50,6 +49,10 @@ enum SupportedActions { ZoomIn = 0, ZoomOut, OriginalSize, FitToScreen, Backgrou
struct ImageViewerActionHandlerPrivate
{
ImageViewerActionHandlerPrivate()
: context(Constants::IMAGEVIEWER_ID)
{}
QPointer<QAction> actionZoomIn;
QPointer<QAction> actionZoomOut;
QPointer<QAction> actionOriginalSize;
@@ -65,9 +68,6 @@ ImageViewerActionHandler::ImageViewerActionHandler(QObject *parent) :
QObject(parent),
d_ptr(new ImageViewerActionHandlerPrivate)
{
d_ptr->context << Core::ICore::instance()->uniqueIDManager()
->uniqueIdentifier(Constants::IMAGEVIEWER_ID);
d_ptr->signalMapper = new QSignalMapper(this);
connect(d_ptr->signalMapper, SIGNAL(mapped(int)), SLOT(actionTriggered(int)));
}
+1 -3
View File
@@ -45,7 +45,6 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/settingsdatabase.h>
#include <coreplugin/icore.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
@@ -106,8 +105,7 @@ bool LocatorPlugin::initialize(const QStringList &, QString *)
m_locatorWidget->setEnabled(false);
Core::StatusBarWidget *view = new Core::StatusBarWidget;
view->setWidget(m_locatorWidget);
view->setContext(Core::Context(core->uniqueIDManager()
->uniqueIdentifier(QLatin1String("LocatorWidget"))));
view->setContext(Core::Context("LocatorWidget"));
view->setPosition(Core::StatusBarWidget::First);
addAutoReleasedObject(view);
+2 -3
View File
@@ -46,7 +46,6 @@
#include <coreplugin/vcsmanager.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/icore.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/filemanager.h>
#include <coreplugin/editormanager/editormanager.h>
@@ -207,7 +206,7 @@ QStringList MercurialPlugin::standardArguments() const
void MercurialPlugin::createMenu()
{
Core::Context context(core->uniqueIDManager()->uniqueIdentifier(QLatin1String(Core::Constants::C_GLOBAL)));
Core::Context context(Core::Constants::C_GLOBAL);
// Create menu item for Mercurial
mercurialContainer = actionManager->createMenu(QLatin1String("Mercurial.MercurialMenu"));
@@ -534,7 +533,7 @@ void MercurialPlugin::outgoing()
void MercurialPlugin::createSubmitEditorActions()
{
Core::Context context(core->uniqueIDManager()->uniqueIdentifier(QLatin1String(Constants::COMMIT_ID)));
Core::Context context(Constants::COMMIT_ID);
Core::Command *command;
editorCommit = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
+1 -3
View File
@@ -47,7 +47,6 @@
#include <coreplugin/icore.h>
#include <coreplugin/messagemanager.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/uniqueidmanager.h>
#include <locator/commandlocator.h>
#include <utils/qtcassert.h>
#include <utils/synchronousprocess.h>
@@ -268,8 +267,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
m_menuAction = mperforce->menu()->menuAction();
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
Core::Context perforcesubmitcontext(
Core::UniqueIDManager::instance()->uniqueIdentifier(Constants::PERFORCESUBMITEDITOR_CONTEXT));
Core::Context perforcesubmitcontext(Constants::PERFORCESUBMITEDITOR_CONTEXT);
Core::Command *command;
+1 -1
View File
@@ -384,7 +384,7 @@ OutputWindow::OutputWindow(QWidget *parent)
static uint usedIds = 0;
Core::ICore *core = Core::ICore::instance();
Core::Context context(core->uniqueIDManager()->uniqueIdentifier(QString(Constants::C_APP_OUTPUT) + QString().setNum(usedIds++)));
Core::Context context(Constants::C_APP_OUTPUT, usedIds++);
m_outputWindowContext = new Core::BaseContext(this, context);
core->addContextObject(m_outputWindowContext);
@@ -80,7 +80,6 @@
#include <coreplugin/mainwindow.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/modemanager.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
@@ -265,7 +264,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
d->m_proWindow = new ProjectWindow;
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
Core::Context pecontext(core->uniqueIDManager()->uniqueIdentifier(Constants::C_PROJECTEXPLORER));
Core::Context pecontext(Constants::C_PROJECTEXPLORER);
d->m_projectsMode = new Core::BaseMode;
d->m_projectsMode->setDisplayName(tr("Projects"));
@@ -1312,12 +1311,12 @@ void ProjectExplorerPlugin::setCurrent(Project *project, QString filePath, Node
Core::Context newContext;
if (d->m_currentProject) {
oldContext.append(d->m_currentProject->projectManager()->projectContext());
oldContext.append(d->m_currentProject->projectManager()->projectLanguage());
oldContext.d.append(d->m_currentProject->projectManager()->projectContext());
oldContext.d.append(d->m_currentProject->projectManager()->projectLanguage());
}
if (project) {
newContext.append(project->projectManager()->projectContext());
newContext.append(project->projectManager()->projectLanguage());
newContext.d.append(project->projectManager()->projectContext());
newContext.d.append(project->projectManager()->projectLanguage());
}
core->updateAdditionalContexts(oldContext, newContext);
+4 -5
View File
@@ -38,7 +38,6 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/icontext.h>
#include <coreplugin/icore.h>
#include <coreplugin/uniqueidmanager.h>
#include <extensionsystem/pluginmanager.h>
#include <QtCore/QDir>
@@ -98,7 +97,7 @@ public:
virtual QWidget *widget();
private:
QWidget *m_taskList;
Core::Context m_context;
const Core::Context m_context;
};
class TaskModel : public QAbstractItemModel
@@ -1000,10 +999,10 @@ void TaskDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
}
TaskWindowContext::TaskWindowContext(QWidget *widget)
: Core::IContext(widget), m_taskList(widget)
: Core::IContext(widget),
m_taskList(widget),
m_context(Core::Constants::C_PROBLEM_PANE)
{
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
m_context << uidm->uniqueIdentifier(Core::Constants::C_PROBLEM_PANE);
}
Core::Context TaskWindowContext::context() const
@@ -30,23 +30,21 @@
#include "designmodecontext.h"
#include "qmldesignerconstants.h"
#include "designmodewidget.h"
#include <coreplugin/uniqueidmanager.h>
#include <QWidget>
namespace QmlDesigner {
namespace Internal {
DesignModeContext::DesignModeContext(DesignModeWidget *widget) : IContext(widget),
m_widget(widget)
DesignModeContext::DesignModeContext(DesignModeWidget *widget)
: IContext(widget),
m_widget(widget),
m_context(Constants::C_FORMEDITOR, Constants::C_QT_QUICK_TOOLS_MENU)
{
Core::UniqueIDManager *uuidManager = Core::UniqueIDManager::instance();
m_context << uuidManager->uniqueIdentifier(Constants::C_FORMEDITOR)
<< uuidManager->uniqueIdentifier(Constants::C_QT_QUICK_TOOLS_MENU);
}
DesignModeContext::~DesignModeContext()
{
}
Core::Context DesignModeContext::context() const
+1 -1
View File
@@ -57,8 +57,8 @@ public:
QString contextHelpId() const;
private:
Core::Context m_context;
DesignModeWidget *m_widget;
const Core::Context m_context;
};
}
+15 -19
View File
@@ -35,24 +35,22 @@
#include "settingspage.h"
#include "designmodecontext.h"
#include <coreplugin/designmode.h>
#include <qmljseditor/qmljseditorconstants.h>
#include <coreplugin/modemanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/icore.h>
#include <coreplugin/icontext.h>
#include <coreplugin/dialogs/iwizard.h>
#include <coreplugin/editormanager/ieditorfactory.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/editormanager/openeditorsmodel.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/designmode.h>
#include <coreplugin/dialogs/iwizard.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditorfactory.h>
#include <coreplugin/editormanager/openeditorsmodel.h>
#include <coreplugin/icontext.h>
#include <coreplugin/icore.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/modemanager.h>
#include <extensionsystem/pluginmanager.h>
#include <utils/qtcassert.h>
@@ -119,8 +117,7 @@ bool BauhausPlugin::initialize(const QStringList & /*arguments*/, QString *error
{
Core::ICore *core = Core::ICore::instance();
const int uid = core->uniqueIDManager()->uniqueIdentifier(QLatin1String(QmlDesigner::Constants::C_FORMEDITOR));
const Core::Context switchContext(core->uniqueIDManager()->uniqueIdentifier(QmlJSEditor::Constants::C_QMLJSEDITOR_ID));
const Core::Context switchContext(QmlJSEditor::Constants::C_QMLJSEDITOR_ID);
Core::ActionManager *am = core->actionManager();
@@ -163,8 +160,7 @@ void BauhausPlugin::createDesignModeWidget()
m_context = new DesignModeContext(m_mainWidget);
creatorCore->addContextObject(m_context);
Core::UniqueIDManager *uuidManager = Core::UniqueIDManager::instance();
Core::Context formEditorContext(uuidManager->uniqueIdentifier(Constants::C_FORMEDITOR));
Core::Context formEditorContext(Constants::C_FORMEDITOR);
// Revert to saved
actionManager->registerAction(m_revertToSavedAction,
@@ -279,8 +275,8 @@ void BauhausPlugin::contextChanged(Core::IContext *context, const Core::Context
{
Q_UNUSED(context)
foreach (int additionalContext, additionalContexts) {
if (m_context->context().contains(additionalContext)) {
foreach (int additionalContext, additionalContexts.d) {
if (m_context->context().d.contains(additionalContext)) {
m_isActive = true;
m_mainWidget->showEditor(m_editorManager->currentEditor());
return;
@@ -34,8 +34,6 @@
#include "components/objecttree.h"
#include <coreplugin/icore.h>
#include <coreplugin/uniqueidmanager.h>
#include <QWidget>
#include <QDebug>
@@ -43,10 +41,11 @@
namespace Qml {
namespace Internal {
InspectorContext::InspectorContext(QWidget *widget) : IContext(widget),
m_widget(widget)
InspectorContext::InspectorContext(QWidget *widget)
: IContext(widget),
m_widget(widget),
m_context(Constants::C_INSPECTOR)
{
m_context << Core::UniqueIDManager::instance()->uniqueIdentifier(Constants::C_INSPECTOR);
}
InspectorContext::~InspectorContext()
@@ -26,6 +26,7 @@
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "qmlinspectorconstants.h"
#include "qmlinspector.h"
#include "qmlinspectorplugin.h"
@@ -47,7 +48,6 @@
#include <projectexplorer/project.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/command.h>
@@ -100,8 +100,7 @@ bool QmlInspectorPlugin::initialize(const QStringList &arguments, QString *error
ExtensionSystem::PluginManager *pluginManager = ExtensionSystem::PluginManager::instance();
Debugger::DebuggerUISwitcher *uiSwitcher = pluginManager->getObject<Debugger::DebuggerUISwitcher>();
uiSwitcher->addLanguage(Qml::Constants::LANG_QML,
Core::Context(core->uniqueIDManager()->uniqueIdentifier(Constants::C_INSPECTOR)));
uiSwitcher->addLanguage(Qml::Constants::LANG_QML, Core::Context(Constants::C_INSPECTOR));
m_inspector = new QmlInspector;
m_inspector->createDockWidgets();
addObject(m_inspector);
+3 -6
View File
@@ -53,7 +53,6 @@
#include <coreplugin/modemanager.h>
#include <coreplugin/designmode.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/uniqueidmanager.h>
#include <extensionsystem/pluginmanager.h>
#include <texteditor/basetextdocument.h>
#include <texteditor/fontsettings.h>
@@ -575,11 +574,9 @@ int SemanticInfo::revision() const
QmlJSEditorEditable::QmlJSEditorEditable(QmlJSTextEditor *editor)
: BaseTextEditorEditable(editor)
{
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
m_context << uidm->uniqueIdentifier(QmlJSEditor::Constants::C_QMLJSEDITOR_ID);
m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
m_context << uidm->uniqueIdentifier(QmlDesigner::Constants::C_QT_QUICK_TOOLS_MENU);
m_context.add(QmlJSEditor::Constants::C_QMLJSEDITOR_ID);
m_context.add(TextEditor::Constants::C_TEXTEDITOR);
m_context.add(QmlDesigner::Constants::C_QT_QUICK_TOOLS_MENU);
}
// Use preferred mode from Bauhaus settings
@@ -43,8 +43,7 @@ namespace QmlJSEditor {
namespace Internal {
QmlJSEditorActionHandler::QmlJSEditorActionHandler()
: TextEditor::TextEditorActionHandler(QLatin1String(QmlJSEditor::Constants::C_QMLJSEDITOR_ID),
Format)
: TextEditor::TextEditorActionHandler(QmlJSEditor::Constants::C_QMLJSEDITOR_ID, Format)
{
}
@@ -110,9 +110,8 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
m_modelManager = new ModelManager(this);
addAutoReleasedObject(m_modelManager);
Core::Context context;
context << core->uniqueIDManager()->uniqueIdentifier(QmlJSEditor::Constants::C_QMLJSEDITOR_ID)
<< core->uniqueIDManager()->uniqueIdentifier(QmlDesigner::Constants::C_QT_QUICK_TOOLS_MENU);
Core::Context context(QmlJSEditor::Constants::C_QMLJSEDITOR_ID,
QmlDesigner::Constants::C_QT_QUICK_TOOLS_MENU);
m_editor = new QmlJSEditorFactory(this);
addObject(m_editor);
@@ -140,7 +139,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
mtools->addMenu(menuQtQuick);
m_actionPreview = new QAction("&Preview", this);
Core::Context toolsMenuContext(core->uniqueIDManager()->uniqueIdentifier(QmlDesigner::Constants::C_QT_QUICK_TOOLS_MENU));
Core::Context toolsMenuContext(QmlDesigner::Constants::C_QT_QUICK_TOOLS_MENU);
Core::Command *cmd = addToolAction(m_actionPreview, am, toolsMenuContext,
QLatin1String("QtQuick.Preview"), menuQtQuick, tr("Ctrl+Alt+R"));
connect(cmd->action(), SIGNAL(triggered()), SLOT(openPreview()));
@@ -37,7 +37,6 @@
#include <coreplugin/icore.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/uniqueidmanager.h>
#include <texteditor/fontsettings.h>
#include <texteditor/texteditoractionhandler.h>
#include <texteditor/texteditorconstants.h>
@@ -54,11 +53,10 @@ using namespace Qt4ProjectManager::Internal;
//
ProFileEditorEditable::ProFileEditorEditable(ProFileEditor *editor)
: BaseTextEditorEditable(editor)
: BaseTextEditorEditable(editor),
m_context(Qt4ProjectManager::Constants::C_PROFILEEDITOR,
TextEditor::Constants::C_TEXTEDITOR)
{
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
m_context << uidm->uniqueIdentifier(Qt4ProjectManager::Constants::C_PROFILEEDITOR);
m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
// m_contexts << uidm->uniqueIdentifier(Qt4ProjectManager::Constants::PROJECT_KIND);
}
@@ -62,7 +62,7 @@ public:
QString id() const;
bool isTemporary() const { return false; }
private:
Core::Context m_context;
const Core::Context m_context;
};
class ProFileEditor : public TextEditor::BaseTextEditor
@@ -60,7 +60,6 @@
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/projectnodes.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
@@ -173,9 +172,7 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
am->actionContainer(ProjectExplorer::Constants::M_SUBPROJECTCONTEXT);
//register actions
m_projectContext = core->uniqueIDManager()->
uniqueIdentifier(Qt4ProjectManager::Constants::PROJECT_ID);
Core::Context context(m_projectContext);
Core::Context context(Qt4ProjectManager::Constants::PROJECT_ID);
Core::Command *command;
QIcon qmakeIcon(QLatin1String(":/qt4projectmanager/images/run_qmake.png"));
@@ -86,14 +86,13 @@ private:
ProFileEditorFactory *m_proFileEditorFactory;
Qt4Manager *m_qt4ProjectManager;
int m_projectContext;
QAction *m_runQMakeAction;
QAction *m_runQMakeActionContextMenu;
QAction *m_buildSubProjectContextMenu;
QAction *m_rebuildSubProjectContextMenu;
QAction *m_cleanSubProjectContextMenu;
GettingStartedWelcomePage *m_welcomePage;
int m_projectContext;
};
} // namespace Internal
@@ -32,7 +32,6 @@
#include "resourceeditorplugin.h"
#include "resourceeditorconstants.h"
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/fileiconprovider.h>
#include <coreplugin/editormanager/editormanager.h>
@@ -45,10 +44,9 @@ using namespace ResourceEditor::Constants;
ResourceEditorFactory::ResourceEditorFactory(ResourceEditorPlugin *plugin) :
Core::IEditorFactory(plugin),
m_mimeTypes(QStringList(QLatin1String("application/vnd.nokia.xml.qt.resource"))),
m_context(ResourceEditor::Constants::C_RESOURCEEDITOR),
m_plugin(plugin)
{
m_context += Core::UniqueIDManager::instance()
->uniqueIdentifier(QLatin1String(ResourceEditor::Constants::C_RESOURCEEDITOR));
Core::FileIconProvider *iconProvider = Core::FileIconProvider::instance();
iconProvider->registerIconOverlayForSuffix(QIcon(":/resourceeditor/images/qt_qrc.png"),
QLatin1String("qrc"));
@@ -57,7 +57,7 @@ public:
private:
const QStringList m_mimeTypes;
Core::Context m_context;
const Core::Context m_context;
ResourceEditorPlugin *m_plugin;
};
@@ -87,12 +87,10 @@ bool ResourceEditorPlugin::initialize(const QStringList &arguments, QString *err
errorMessage->clear();
// Register undo and redo
Core::ActionManager * const actionManager = core->actionManager();
int const contextId = core->uniqueIDManager()->uniqueIdentifier(
Constants::C_RESOURCEEDITOR);
const Core::Context context(contextId);
const Core::Context context(Constants::C_RESOURCEEDITOR);
m_undoAction = new QAction(tr("&Undo"), this);
m_redoAction = new QAction(tr("&Redo"), this);
Core::ActionManager * const actionManager = core->actionManager();
actionManager->registerAction(m_undoAction, Core::Constants::UNDO, context);
actionManager->registerAction(m_redoAction, Core::Constants::REDO, context);
connect(m_undoAction, SIGNAL(triggered()), this, SLOT(onUndo()));
+2 -5
View File
@@ -49,7 +49,6 @@
#include <coreplugin/filemanager.h>
#include <coreplugin/messagemanager.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
@@ -304,8 +303,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
subversionMenu->menu()->setTitle(tr("&Subversion"));
toolsContainer->addMenu(subversionMenu);
m_menuAction = subversionMenu->menu()->menuAction();
Core::Context globalcontext(core->uniqueIDManager()->uniqueIdentifier(C_GLOBAL));
Core::Context globalcontext(C_GLOBAL);
Core::Command *command;
m_diffCurrentAction = new Utils::ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
@@ -456,8 +454,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
m_commandLocator->appendCommand(command);
// Actions of the submit editor
Core::Context svncommitcontext;
svncommitcontext << Core::UniqueIDManager::instance()->uniqueIdentifier(Constants::SUBVERSIONCOMMITEDITOR);
Core::Context svncommitcontext(Constants::SUBVERSIONCOMMITEDITOR);
m_submitCurrentLogAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
command = ami->registerAction(m_submitCurrentLogAction, Constants::SUBMIT_CURRENT, svncommitcontext);
+2 -5
View File
@@ -43,7 +43,6 @@
#include "fontsettings.h"
#include <coreplugin/coreconstants.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/mimedatabase.h>
@@ -56,11 +55,9 @@ using namespace TextEditor;
using namespace TextEditor::Internal;
PlainTextEditorEditable::PlainTextEditorEditable(PlainTextEditor *editor)
: BaseTextEditorEditable(editor)
: BaseTextEditorEditable(editor),
m_context(Core::Constants::K_DEFAULT_TEXT_EDITOR_ID, TextEditor::Constants::C_TEXTEDITOR)
{
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
m_context << uidm->uniqueIdentifier(Core::Constants::K_DEFAULT_TEXT_EDITOR_ID);
m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
}
PlainTextEditor::PlainTextEditor(QWidget *parent)
+1 -1
View File
@@ -59,7 +59,7 @@ public:
virtual QString id() const;
private:
Core::Context m_context;
const Core::Context m_context;
};
class TEXTEDITOR_EXPORT PlainTextEditor : public BaseTextEditor
@@ -48,7 +48,7 @@ PlainTextEditorFactory::PlainTextEditorFactory(QObject *parent)
: Core::IEditorFactory(parent)
{
m_actionHandler = new TextEditorActionHandler(
QLatin1String(TextEditor::Constants::C_TEXTEDITOR),
TextEditor::Constants::C_TEXTEDITOR,
TextEditorActionHandler::Format |
TextEditorActionHandler::UnCommentSelection |
TextEditorActionHandler::UnCollapseAll);
@@ -38,7 +38,6 @@
#include <locator/locatormanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
@@ -53,7 +52,7 @@
using namespace TextEditor;
using namespace TextEditor::Internal;
TextEditorActionHandler::TextEditorActionHandler(const QString &context,
TextEditorActionHandler::TextEditorActionHandler(const char *context,
uint optionalActions)
: QObject(Core::ICore::instance()),
m_undoAction(0),
@@ -91,10 +90,9 @@ TextEditorActionHandler::TextEditorActionHandler(const QString &context,
m_joinLinesAction(0),
m_optionalActions(optionalActions),
m_currentEditor(0),
m_contextId(context),
m_initialized(false)
{
m_contextId << Core::UniqueIDManager::instance()->uniqueIdentifier(context);
connect(Core::ICore::instance()->editorManager(), SIGNAL(currentEditorChanged(Core::IEditor*)),
this, SLOT(updateCurrentEditor(Core::IEditor*)));
}
@@ -57,7 +57,7 @@ public:
UnCollapseAll = 4
};
TextEditorActionHandler(const QString &context, uint optionalActions = None);
TextEditorActionHandler(const char *context, uint optionalActions = None);
void setupActions(BaseTextEditor *editor);
void initializeActions();
+1 -3
View File
@@ -44,7 +44,6 @@
#include <coreplugin/icore.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/editormanager/editormanager.h>
@@ -116,8 +115,7 @@ bool TextEditorPlugin::initialize(const QStringList &arguments, QString *errorMe
m_lineNumberFilter = new LineNumberFilter;
addAutoReleasedObject(m_lineNumberFilter);
int contextId = core->uniqueIDManager()->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
Core::Context context(contextId);
Core::Context context(TextEditor::Constants::C_TEXTEDITOR);
Core::ActionManager *am = core->actionManager();
// Add shortcut for invoking automatic completion
+1 -4
View File
@@ -34,7 +34,6 @@
#include "vcsbaseconstants.h"
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/ifile.h>
#include <coreplugin/iversioncontrol.h>
#include <extensionsystem/pluginmanager.h>
@@ -99,11 +98,9 @@ VCSBaseEditorEditable::VCSBaseEditorEditable(VCSBaseEditor *editor,
const VCSBaseEditorParameters *type) :
BaseTextEditorEditable(editor),
m_id(type->id),
m_context(type->context, TextEditor::Constants::C_TEXTEDITOR),
m_temporary(false)
{
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
m_context << uidm->uniqueIdentifier(QLatin1String(type->context))
<< uidm->uniqueIdentifier(QLatin1String(TextEditor::Constants::C_TEXTEDITOR));
}
Core::Context VCSBaseEditorEditable::context() const
+3 -3
View File
@@ -93,12 +93,12 @@ struct VCSBaseSubmitEditorPrivate
QString m_displayName;
QString m_checkScriptWorkingDirectory;
VCSBase::Internal::SubmitEditorFile *m_file;
Core::Context m_contexts;
QPointer<QAction> m_diffAction;
QPointer<QAction> m_submitAction;
Internal::NickNameDialog *m_nickNameDialog;
Core::Context m_contexts;
};
VCSBaseSubmitEditorPrivate::VCSBaseSubmitEditorPrivate(const VCSBaseSubmitEditorParameters *parameters,
@@ -108,9 +108,9 @@ VCSBaseSubmitEditorPrivate::VCSBaseSubmitEditorPrivate(const VCSBaseSubmitEditor
m_toolWidget(0),
m_parameters(parameters),
m_file(new VCSBase::Internal::SubmitEditorFile(QLatin1String(m_parameters->mimeType), q)),
m_nickNameDialog(0)
m_nickNameDialog(0),
m_contexts(m_parameters->context)
{
m_contexts << Core::UniqueIDManager::instance()->uniqueIdentifier(m_parameters->context);
}
VCSBaseSubmitEditor::VCSBaseSubmitEditor(const VCSBaseSubmitEditorParameters *parameters,
+1 -3
View File
@@ -34,7 +34,6 @@
#include <coreplugin/icore.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/uniqueidmanager.h>
#include <utils/styledbar.h>
#include <utils/welcomemodetreewidget.h>
@@ -150,8 +149,7 @@ QString WelcomeMode::id() const
Core::Context WelcomeMode::context() const
{
static Core::Context contexts =
Core::Context(Core::UniqueIDManager::instance()->uniqueIdentifier(Core::Constants::C_WELCOME_MODE));
static Core::Context contexts(Core::Constants::C_WELCOME_MODE);
return contexts;
}