OSDN Git Service

Merge remote branch 'origin/2.0'
[qt-creator-jp/qt-creator-jp.git] / src / plugins / qmldesigner / qmldesignerplugin.cpp
index 596e1cf..738a3fc 100644 (file)
 #include "qmlcontextpane.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/actionmanager.h>
 #include <coreplugin/actionmanager/command.h>
-#include <coreplugin/icore.h>
-#include <coreplugin/icontext.h>
+#include <coreplugin/coreconstants.h>
+#include <coreplugin/designmode.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/ieditorfactory.h>
 #include <coreplugin/editormanager/openeditorsmodel.h>
-#include <coreplugin/actionmanager/actionmanager.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>
@@ -121,11 +119,8 @@ 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 QList<int> context = QList<int>() << uid;
-
-    const QList<int> switchContext = QList<int>() << uid
-                                     << core->uniqueIDManager()->uniqueIdentifier(QmlJSEditor::Constants::C_QMLJSEDITOR_ID);
+    const Core::Context switchContext(QmlDesigner::Constants::C_FORMEDITOR,
+        QmlJSEditor::Constants::C_QMLJSEDITOR_ID);
 
     Core::ActionManager *am = core->actionManager();
 
@@ -170,8 +165,7 @@ void BauhausPlugin::createDesignModeWidget()
 
     m_context = new DesignModeContext(m_mainWidget);
     creatorCore->addContextObject(m_context);
-    Core::UniqueIDManager *uuidManager = Core::UniqueIDManager::instance();
-    QList<int> formEditorContext = QList<int> () << uuidManager->uniqueIdentifier(Constants::C_FORMEDITOR);
+    Core::Context formEditorContext(Constants::C_FORMEDITOR);
 
     // Revert to saved
     actionManager->registerAction(m_revertToSavedAction,
@@ -267,8 +261,8 @@ void BauhausPlugin::createDesignModeWidget()
     connect(m_editorManager, SIGNAL(editorsClosed(QList<Core::IEditor*>)),
             this, SLOT(textEditorsClosed(QList<Core::IEditor*>)));
 
-    connect(creatorCore, SIGNAL(contextChanged(Core::IContext*,QList<int>)),
-            this, SLOT(contextChanged(Core::IContext*,QList<int>)));
+    connect(creatorCore, SIGNAL(contextChanged(Core::IContext*,Core::Context)),
+            this, SLOT(contextChanged(Core::IContext*,Core::Context)));
 
 }
 
@@ -282,11 +276,11 @@ void BauhausPlugin::updateEditor(Core::IEditor *editor)
     }
 }
 
-void BauhausPlugin::contextChanged(Core::IContext *context, const QList<int> &additionalContexts)
+void BauhausPlugin::contextChanged(Core::IContext *context, const Core::Context &additionalContexts)
 {
     Q_UNUSED(context)
 
-    foreach(int additionalContext, additionalContexts) {
+    foreach (int additionalContext, additionalContexts) {
         if (m_context->context().contains(additionalContext)) {
             m_isActive = true;
             m_mainWidget->showEditor(m_editorManager->currentEditor());