Commit 4637b3fe authored by hjk's avatar hjk

Debugger: Don't crash if targets vanish if the last kit is deleted

Task-number: QTCREATORBUG-17702
Change-Id: I42cc08cab67f57d749898f5b01925b7ef3658165
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger's avatarChristian Stenger <christian.stenger@qt.io>
parent 311bed93
......@@ -963,7 +963,6 @@ public:
void updateUiForProject(ProjectExplorer::Project *project);
void updateUiForTarget(ProjectExplorer::Target *target);
void updateUiForRunConfiguration(ProjectExplorer::RunConfiguration *rc);
void updateActiveLanguages();
public:
......@@ -3332,12 +3331,11 @@ void DebuggerPluginPrivate::updateUiForProject(Project *project)
}
m_previousProject = project;
if (!project) {
updateUiForTarget(0);
updateUiForTarget(nullptr);
return;
}
connect(project, &Project::activeTargetChanged,
this, &DebuggerPluginPrivate::updateUiForTarget,
Qt::QueuedConnection);
this, &DebuggerPluginPrivate::updateUiForTarget);
updateUiForTarget(project->activeTarget());
}
......@@ -3345,35 +3343,19 @@ void DebuggerPluginPrivate::updateUiForTarget(Target *target)
{
if (m_previousTarget) {
disconnect(m_previousTarget.data(), &Target::activeRunConfigurationChanged,
this, &DebuggerPluginPrivate::updateUiForRunConfiguration);
this, &DebuggerPluginPrivate::updateActiveLanguages);
}
m_previousTarget = target;
if (!target) {
updateUiForRunConfiguration(0);
updateActiveLanguages();
return;
}
connect(target, &Target::activeRunConfigurationChanged,
this, &DebuggerPluginPrivate::updateUiForRunConfiguration,
Qt::QueuedConnection);
updateUiForRunConfiguration(target->activeRunConfiguration());
}
// updates default debug language settings per run config.
void DebuggerPluginPrivate::updateUiForRunConfiguration(RunConfiguration *rc)
{
// if (m_previousRunConfiguration)
// disconnect(m_previousRunConfiguration, &RunConfiguration::requestRunActionsUpdate,
// this, &DebuggerPluginPrivate::updateActiveLanguages);
// m_previousRunConfiguration = rc;
Q_UNUSED(rc); // FIXME
this, &DebuggerPluginPrivate::updateActiveLanguages);
updateActiveLanguages();
// if (m_previousRunConfiguration)
// connect(m_previousRunConfiguration, &RunConfiguration::requestRunActionsUpdate,
// this, &DebuggerPluginPrivate::updateActiveLanguages,
// Qt::QueuedConnection);
}
void DebuggerPluginPrivate::updateActiveLanguages()
......
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