Commit 347cb21a authored by Daniel Teske's avatar Daniel Teske

DesktopQmakeRunConfiguration: Optimize response to proFile parsing

Only emit the environment changed signal after everything has parsed.

Change-Id: Iba26c8ba2fc7de9e03ec1368917985538ffbbfb9
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 2cc17a61
......@@ -128,18 +128,8 @@ QString DesktopQmakeRunConfiguration::disabledReason() const
void DesktopQmakeRunConfiguration::proFileUpdated(QmakeProFileNode *pro, bool success, bool parseInProgress)
{
LocalEnvironmentAspect *aspect = extraAspect<LocalEnvironmentAspect>();
QTC_ASSERT(aspect, return);
if (m_proFilePath != pro->path()) {
if (!parseInProgress) {
// We depend on all .pro files for the LD_LIBRARY_PATH so we emit a signal for all .pro files
// This can be optimized by checking whether LD_LIBRARY_PATH changed
aspect->buildEnvironmentHasChanged();
}
if (m_proFilePath != pro->path())
return;
}
bool enabled = isEnabled();
QString reason = disabledReason();
m_parseSuccess = success;
......@@ -149,10 +139,21 @@ void DesktopQmakeRunConfiguration::proFileUpdated(QmakeProFileNode *pro, bool su
if (!parseInProgress) {
emit effectiveTargetInformationChanged();
LocalEnvironmentAspect *aspect = extraAspect<LocalEnvironmentAspect>();
QTC_ASSERT(aspect, return);
aspect->buildEnvironmentHasChanged();
}
}
void DesktopQmakeRunConfiguration::proFileEvaluated()
{
// We depend on all .pro files for the LD_LIBRARY_PATH so we emit a signal for all .pro files
// This can be optimized by checking whether LD_LIBRARY_PATH changed
LocalEnvironmentAspect *aspect = extraAspect<LocalEnvironmentAspect>();
QTC_ASSERT(aspect, return);
aspect->buildEnvironmentHasChanged();
}
void DesktopQmakeRunConfiguration::ctor()
{
setDefaultDisplayName(defaultDisplayName());
......@@ -163,6 +164,8 @@ void DesktopQmakeRunConfiguration::ctor()
QmakeProject *project = static_cast<QmakeProject *>(target()->project());
connect(project, &QmakeProject::proFileUpdated,
this, &DesktopQmakeRunConfiguration::proFileUpdated);
connect(project, &QmakeProject::proFilesEvaluated,
this, &DesktopQmakeRunConfiguration::proFileEvaluated);
connect(target(), &Target::kitChanged,
this, &DesktopQmakeRunConfiguration::kitChanged);
}
......
......@@ -107,6 +107,7 @@ signals:
private slots:
void kitChanged();
void proFileUpdated(QmakeProjectManager::QmakeProFileNode *pro, bool success, bool parseInProgress);
void proFileEvaluated();
protected:
DesktopQmakeRunConfiguration(ProjectExplorer::Target *parent, DesktopQmakeRunConfiguration *source);
......
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