forked from qt-creator/qt-creator
ProjectExplorer: Update run config list centrally
This prodecure requires no further information from the specific project managers, so we can start it from the ProjectExplorer itself. Also wait until after project parsing has officially finished and the run configurations have updated their "enabled" state. Otherwise, RunConfiguration::isEnabled() will always return false, potentially leading to the active run configuration getting switched unintentionally. Fixes: QTCREATORBUG-21692 Change-Id: I32f4f758b5baa6222329d07b811993568eff1ee3 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -375,8 +375,6 @@ void CMakeProject::updateProjectData(CMakeBuildConfiguration *bc)
|
|||||||
Target *t = bc->target();
|
Target *t = bc->target();
|
||||||
t->setApplicationTargets(bc->appTargets());
|
t->setApplicationTargets(bc->appTargets());
|
||||||
t->setDeploymentData(bc->deploymentData());
|
t->setDeploymentData(bc->deploymentData());
|
||||||
|
|
||||||
t->updateDefaultRunConfigurations();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@@ -118,6 +118,12 @@ Target::Target(Project *project, Kit *k, _constructor_tag) :
|
|||||||
{
|
{
|
||||||
QTC_CHECK(d->m_kit);
|
QTC_CHECK(d->m_kit);
|
||||||
connect(DeviceManager::instance(), &DeviceManager::updated, this, &Target::updateDeviceState);
|
connect(DeviceManager::instance(), &DeviceManager::updated, this, &Target::updateDeviceState);
|
||||||
|
connect(project, &Project::parsingFinished, this, [this](bool success) {
|
||||||
|
if (success && this->project() == SessionManager::startupProject()
|
||||||
|
&& this == this->project()->activeTarget()) {
|
||||||
|
updateDefaultRunConfigurations();
|
||||||
|
}
|
||||||
|
}, Qt::QueuedConnection); // Must wait for run configs to change their enabled state.
|
||||||
|
|
||||||
setDisplayName(d->m_kit->displayName());
|
setDisplayName(d->m_kit->displayName());
|
||||||
setToolTip(d->m_kit->toHtml());
|
setToolTip(d->m_kit->toHtml());
|
||||||
|
@@ -1199,8 +1199,6 @@ void QbsProject::updateBuildTargetData()
|
|||||||
OpTimer optimer("updateBuildTargetData");
|
OpTimer optimer("updateBuildTargetData");
|
||||||
updateApplicationTargets();
|
updateApplicationTargets();
|
||||||
updateDeploymentInfo();
|
updateDeploymentInfo();
|
||||||
if (activeTarget())
|
|
||||||
activeTarget()->updateDefaultRunConfigurations();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -348,12 +348,6 @@ void QmakeProject::updateQmlJSCodeModel()
|
|||||||
modelManager->updateProjectInfo(projectInfo, this);
|
modelManager->updateProjectInfo(projectInfo, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmakeProject::updateRunConfigurations()
|
|
||||||
{
|
|
||||||
if (activeTarget())
|
|
||||||
activeTarget()->updateDefaultRunConfigurations();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QmakeProject::scheduleAsyncUpdate(QmakeProFile *file, QmakeProFile::AsyncUpdateDelay delay)
|
void QmakeProject::scheduleAsyncUpdate(QmakeProFile *file, QmakeProFile::AsyncUpdateDelay delay)
|
||||||
{
|
{
|
||||||
if (m_asyncUpdateState == ShuttingDown)
|
if (m_asyncUpdateState == ShuttingDown)
|
||||||
@@ -492,7 +486,6 @@ void QmakeProject::decrementPendingEvaluateFutures()
|
|||||||
updateBuildSystemData();
|
updateBuildSystemData();
|
||||||
if (activeTarget())
|
if (activeTarget())
|
||||||
activeTarget()->updateDefaultDeployConfigurations();
|
activeTarget()->updateDefaultDeployConfigurations();
|
||||||
updateRunConfigurations();
|
|
||||||
emitParsingFinished(true); // Qmake always returns (some) data, even when it failed:-)
|
emitParsingFinished(true); // Qmake always returns (some) data, even when it failed:-)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -131,7 +131,6 @@ private:
|
|||||||
void setAllBuildConfigurationsEnabled(bool enabled);
|
void setAllBuildConfigurationsEnabled(bool enabled);
|
||||||
|
|
||||||
QString executableFor(const QmakeProFile *file);
|
QString executableFor(const QmakeProFile *file);
|
||||||
void updateRunConfigurations();
|
|
||||||
|
|
||||||
void updateCppCodeModel();
|
void updateCppCodeModel();
|
||||||
void updateQmlJSCodeModel();
|
void updateQmlJSCodeModel();
|
||||||
|
Reference in New Issue
Block a user