Commit fd81a276 authored by Lasse Holmstedt's avatar Lasse Holmstedt
Browse files

Only attempt to connect debugger if debug mode is activated

parent 0535eb09
...@@ -1259,7 +1259,7 @@ void ProjectExplorerPlugin::buildStateChanged(Project * pro) ...@@ -1259,7 +1259,7 @@ void ProjectExplorerPlugin::buildStateChanged(Project * pro)
void ProjectExplorerPlugin::executeRunConfiguration(RunConfiguration *runConfiguration, const QString &runMode) void ProjectExplorerPlugin::executeRunConfiguration(RunConfiguration *runConfiguration, const QString &runMode)
{ {
if (IRunControlFactory *runControlFactory = findRunControlFactory(runConfiguration, runMode)) { if (IRunControlFactory *runControlFactory = findRunControlFactory(runConfiguration, runMode)) {
emit aboutToExecuteProject(runConfiguration->target()->project()); emit aboutToExecuteProject(runConfiguration->target()->project(), runMode);
RunControl *control = runControlFactory->create(runConfiguration, runMode); RunControl *control = runControlFactory->create(runConfiguration, runMode);
startRunControl(control, runMode); startRunControl(control, runMode);
......
...@@ -146,7 +146,7 @@ signals: ...@@ -146,7 +146,7 @@ signals:
void currentProjectChanged(ProjectExplorer::Project *project); void currentProjectChanged(ProjectExplorer::Project *project);
void currentNodeChanged(ProjectExplorer::Node *node, ProjectExplorer::Project *project); void currentNodeChanged(ProjectExplorer::Node *node, ProjectExplorer::Project *project);
void aboutToExecuteProject(ProjectExplorer::Project *project); void aboutToExecuteProject(ProjectExplorer::Project *project, const QString &runMode);
void settingsChanged(); void settingsChanged();
......
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
using namespace Qml; using namespace Qml;
static QToolButton *createToolButton(QAction *action) static QToolButton *createToolButton(QAction *action)
{ {
QToolButton *button = new QToolButton; QToolButton *button = new QToolButton;
...@@ -95,6 +96,7 @@ bool QmlInspectorPlugin::initialize(const QStringList &arguments, QString *error ...@@ -95,6 +96,7 @@ bool QmlInspectorPlugin::initialize(const QStringList &arguments, QString *error
Q_UNUSED(arguments); Q_UNUSED(arguments);
Q_UNUSED(errorString); Q_UNUSED(errorString);
Core::ICore *core = Core::ICore::instance();
connect(Core::ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)), connect(Core::ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)),
SLOT(prepareDebugger(Core::IMode*))); SLOT(prepareDebugger(Core::IMode*)));
...@@ -119,8 +121,8 @@ void QmlInspectorPlugin::extensionsInitialized() ...@@ -119,8 +121,8 @@ void QmlInspectorPlugin::extensionsInitialized()
ProjectExplorer::ProjectExplorerPlugin *pex = ProjectExplorer::ProjectExplorerPlugin::instance(); ProjectExplorer::ProjectExplorerPlugin *pex = ProjectExplorer::ProjectExplorerPlugin::instance();
if (pex) { if (pex) {
connect(pex, SIGNAL(aboutToExecuteProject(ProjectExplorer::Project*)), connect(pex, SIGNAL(aboutToExecuteProject(ProjectExplorer::Project*, QString)),
SLOT(activateDebuggerForProject(ProjectExplorer::Project*))); SLOT(activateDebuggerForProject(ProjectExplorer::Project*, QString)));
} }
QWidget *configBar = new QWidget; QWidget *configBar = new QWidget;
...@@ -147,11 +149,13 @@ void QmlInspectorPlugin::activateDebugger(const QString &langName) ...@@ -147,11 +149,13 @@ void QmlInspectorPlugin::activateDebugger(const QString &langName)
} }
} }
void QmlInspectorPlugin::activateDebuggerForProject(ProjectExplorer::Project *project) void QmlInspectorPlugin::activateDebuggerForProject(ProjectExplorer::Project *project, const QString &runMode)
{ {
QmlProjectManager::QmlProject *qmlproj = qobject_cast<QmlProjectManager::QmlProject*>(project); if (runMode == ProjectExplorer::Constants::DEBUGMODE) {
if (qmlproj) QmlProjectManager::QmlProject *qmlproj = qobject_cast<QmlProjectManager::QmlProject*>(project);
m_connectionTimer->start(); if (qmlproj)
m_connectionTimer->start();
}
} }
void QmlInspectorPlugin::pollInspector() void QmlInspectorPlugin::pollInspector()
......
...@@ -64,7 +64,7 @@ public: ...@@ -64,7 +64,7 @@ public:
public slots: public slots:
void activateDebugger(const QString &langName); void activateDebugger(const QString &langName);
void activateDebuggerForProject(ProjectExplorer::Project *project); void activateDebuggerForProject(ProjectExplorer::Project *project, const QString &runMode);
void setDockWidgetArrangement(const QString &activeLanguage); void setDockWidgetArrangement(const QString &activeLanguage);
private slots: private slots:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment