summaryrefslogtreecommitdiff
path: root/src/plugins/qmlinspector/qmlinspectorplugin.cpp
diff options
context:
space:
mode:
authorLasse Holmstedt <lasse.holmstedt@nokia.com>2010-04-13 15:15:02 +0200
committercon <qtc-committer@nokia.com>2010-04-13 17:22:35 +0200
commit42f96d02e297e5b8bc7b79c0a2d65b3118736b43 (patch)
tree675a68df8f8a3102de281fb26a9be77e7c3cbf76 /src/plugins/qmlinspector/qmlinspectorplugin.cpp
parent70a45da6c2f5c8481d82fff1dcabd5d18370d3b9 (diff)
downloadqt-creator-42f96d02e297e5b8bc7b79c0a2d65b3118736b43.tar.gz
Fixed auto-switching issues with QML inspector and c++ debugger
Reviewed-by: hjk (cherry picked from commit af3f10dfdd91b070512bdc8abda954bbb29396dc)
Diffstat (limited to 'src/plugins/qmlinspector/qmlinspectorplugin.cpp')
-rw-r--r--src/plugins/qmlinspector/qmlinspectorplugin.cpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/plugins/qmlinspector/qmlinspectorplugin.cpp b/src/plugins/qmlinspector/qmlinspectorplugin.cpp
index 1d8c8414c7..8eb3b18a49 100644
--- a/src/plugins/qmlinspector/qmlinspectorplugin.cpp
+++ b/src/plugins/qmlinspector/qmlinspectorplugin.cpp
@@ -37,8 +37,7 @@
#include <qmljseditor/qmljseditorconstants.h>
#include <coreplugin/modemanager.h>
-#include <coreplugin/editormanager/ieditor.h>
-#include <coreplugin/editormanager/editormanager.h>
+#include <projectexplorer/projectexplorer.h>
#include <extensionsystem/pluginmanager.h>
#include <coreplugin/icore.h>
@@ -117,7 +116,7 @@ void QmlInspectorPlugin::extensionsInitialized()
{
ExtensionSystem::PluginManager *pluginManager = ExtensionSystem::PluginManager::instance();
Debugger::DebuggerUISwitcher *uiSwitcher = pluginManager->getObject<Debugger::DebuggerUISwitcher>();
- //connect(uiSwitcher, SIGNAL(languageChanged(QString)), SLOT(activateDebugger(QString)));
+
connect(uiSwitcher, SIGNAL(dockArranged(QString)), SLOT(setDockWidgetArrangement(QString)));
ProjectExplorer::ProjectExplorerPlugin *pex = ProjectExplorer::ProjectExplorerPlugin::instance();
@@ -143,18 +142,13 @@ void QmlInspectorPlugin::extensionsInitialized()
uiSwitcher->setToolbar(Qml::Constants::LANG_QML, configBar);
}
-void QmlInspectorPlugin::activateDebugger(const QString &langName)
-{
- if (langName == Qml::Constants::LANG_QML) {
- m_inspector->connectToViewer();
- }
-}
-
void QmlInspectorPlugin::activateDebuggerForProject(ProjectExplorer::Project *project, const QString &runMode)
{
if (runMode == ProjectExplorer::Constants::DEBUGMODE) {
- QmlProjectManager::QmlProject *qmlproj = qobject_cast<QmlProjectManager::QmlProject*>(project);
- if (qmlproj)
+ // FIXME we probably want to activate the debugger for other projects than QmlProjects,
+ // if they contain Qml files. Some kind of options should exist for this behavior.
+ //QmlProjectManager::QmlProject *qmlproj = qobject_cast<QmlProjectManager::QmlProject*>(project);
+ //if (qmlproj)
m_connectionTimer->start();
}
@@ -180,10 +174,10 @@ void QmlInspectorPlugin::prepareDebugger(Core::IMode *mode)
if (mode->id() != Debugger::Constants::MODE_DEBUG)
return;
- Core::EditorManager *editorManager = Core::EditorManager::instance();
+ ProjectExplorer::ProjectExplorerPlugin *pex = ProjectExplorer::ProjectExplorerPlugin::instance();
- if (editorManager->currentEditor() &&
- editorManager->currentEditor()->id() == QmlJSEditor::Constants::C_QMLJSEDITOR_ID) {
+ if (pex->startupProject() && pex->startupProject()->id() == "QmlProjectManager.QmlProject")
+ {
ExtensionSystem::PluginManager *pluginManager = ExtensionSystem::PluginManager::instance();
Debugger::DebuggerUISwitcher *uiSwitcher = pluginManager->getObject<Debugger::DebuggerUISwitcher>();
uiSwitcher->setActiveLanguage(Qml::Constants::LANG_QML);