Only attempt to connect debugger if debug mode is activated

This commit is contained in:
Lasse Holmstedt
2010-03-17 08:56:42 +01:00
parent 0535eb09b9
commit fd81a276ca
4 changed files with 13 additions and 9 deletions

View File

@@ -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);

View File

@@ -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();

View File

@@ -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
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()
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)
} }
} }
void QmlInspectorPlugin::activateDebuggerForProject(ProjectExplorer::Project *project) void QmlInspectorPlugin::activateDebuggerForProject(ProjectExplorer::Project *project, const QString &runMode)
{ {
if (runMode == ProjectExplorer::Constants::DEBUGMODE) {
QmlProjectManager::QmlProject *qmlproj = qobject_cast<QmlProjectManager::QmlProject*>(project); QmlProjectManager::QmlProject *qmlproj = qobject_cast<QmlProjectManager::QmlProject*>(project);
if (qmlproj) if (qmlproj)
m_connectionTimer->start(); m_connectionTimer->start();
}
} }
void QmlInspectorPlugin::pollInspector() void QmlInspectorPlugin::pollInspector()

View File

@@ -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: