forked from qt-creator/qt-creator
core: use a class derived from QList<int> instead of a QList<int> for Core::Context
A mostly mechanical change. Reviewed-By: con
This commit is contained in:
@@ -713,7 +713,7 @@ bool QmlJSEditorEditable::open(const QString &fileName)
|
||||
return b;
|
||||
}
|
||||
|
||||
QmlJSTextEditor::Context QmlJSEditorEditable::context() const
|
||||
Core::Context QmlJSEditorEditable::context() const
|
||||
{
|
||||
return m_context;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ class QmlJSEditorEditable : public TextEditor::BaseTextEditorEditable
|
||||
|
||||
public:
|
||||
QmlJSEditorEditable(QmlJSTextEditor *);
|
||||
QList<int> context() const;
|
||||
Core::Context context() const;
|
||||
|
||||
bool duplicateSupported() const { return true; }
|
||||
Core::IEditor *duplicate(QWidget *parent);
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
virtual QString preferredMode() const;
|
||||
|
||||
private:
|
||||
QList<int> m_context;
|
||||
Core::Context m_context;
|
||||
};
|
||||
|
||||
struct Declaration
|
||||
@@ -204,8 +204,6 @@ class QmlJSTextEditor : public TextEditor::BaseTextEditor
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
typedef QList<int> Context;
|
||||
|
||||
QmlJSTextEditor(QWidget *parent = 0);
|
||||
~QmlJSTextEditor();
|
||||
|
||||
@@ -262,7 +260,7 @@ private:
|
||||
|
||||
SemanticHighlighter::Source currentSource(bool force = false);
|
||||
|
||||
const Context m_context;
|
||||
const Core::Context m_context;
|
||||
|
||||
QTimer *m_updateDocumentTimer;
|
||||
QTimer *m_updateUsesTimer;
|
||||
|
||||
@@ -110,7 +110,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
|
||||
m_modelManager = new ModelManager(this);
|
||||
addAutoReleasedObject(m_modelManager);
|
||||
|
||||
QList<int> context;
|
||||
Core::Context context;
|
||||
context << core->uniqueIDManager()->uniqueIdentifier(QmlJSEditor::Constants::C_QMLJSEDITOR_ID)
|
||||
<< core->uniqueIDManager()->uniqueIdentifier(QmlDesigner::Constants::C_QT_QUICK_TOOLS_MENU);
|
||||
|
||||
@@ -140,8 +140,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
|
||||
mtools->addMenu(menuQtQuick);
|
||||
m_actionPreview = new QAction("&Preview", this);
|
||||
|
||||
QList<int> toolsMenuContext = QList<int>()
|
||||
<< core->uniqueIDManager()->uniqueIdentifier(QmlDesigner::Constants::C_QT_QUICK_TOOLS_MENU);
|
||||
Core::Context toolsMenuContext(core->uniqueIDManager()->uniqueIdentifier(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()));
|
||||
@@ -220,7 +219,7 @@ void QmlJSEditorPlugin::followSymbolUnderCursor()
|
||||
}
|
||||
|
||||
Core::Command *QmlJSEditorPlugin::addToolAction(QAction *a, Core::ActionManager *am,
|
||||
const QList<int> &context, const QString &name,
|
||||
Core::Context &context, const QString &name,
|
||||
Core::ActionContainer *c1, const QString &keySequence)
|
||||
{
|
||||
Core::Command *command = am->registerAction(a, name, context);
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#define QMLJSEDITORPLUGIN_H
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
#include <coreplugin/icontext.h>
|
||||
#include <QtCore/QPointer>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QAction)
|
||||
@@ -93,7 +94,7 @@ private Q_SLOTS:
|
||||
void quickFixNow();
|
||||
|
||||
private:
|
||||
Core::Command *addToolAction(QAction *a, Core::ActionManager *am, const QList<int> &context, const QString &name,
|
||||
Core::Command *addToolAction(QAction *a, Core::ActionManager *am, Core::Context &context, const QString &name,
|
||||
Core::ActionContainer *c1, const QString &keySequence);
|
||||
|
||||
static QmlJSEditorPlugin *m_instance;
|
||||
|
||||
Reference in New Issue
Block a user