DesktopQmakeRunConfiguration: Optimize response to proFile parsing

Only emit the environment changed signal after everything has parsed.

Change-Id: Iba26c8ba2fc7de9e03ec1368917985538ffbbfb9
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Daniel Teske
2014-09-12 13:38:49 +02:00
parent 2cc17a61eb
commit 347cb21ae2
2 changed files with 15 additions and 11 deletions

View File

@@ -128,18 +128,8 @@ QString DesktopQmakeRunConfiguration::disabledReason() const
void DesktopQmakeRunConfiguration::proFileUpdated(QmakeProFileNode *pro, bool success, bool parseInProgress) void DesktopQmakeRunConfiguration::proFileUpdated(QmakeProFileNode *pro, bool success, bool parseInProgress)
{ {
LocalEnvironmentAspect *aspect = extraAspect<LocalEnvironmentAspect>(); if (m_proFilePath != pro->path())
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();
}
return; return;
}
bool enabled = isEnabled(); bool enabled = isEnabled();
QString reason = disabledReason(); QString reason = disabledReason();
m_parseSuccess = success; m_parseSuccess = success;
@@ -149,10 +139,21 @@ void DesktopQmakeRunConfiguration::proFileUpdated(QmakeProFileNode *pro, bool su
if (!parseInProgress) { if (!parseInProgress) {
emit effectiveTargetInformationChanged(); emit effectiveTargetInformationChanged();
LocalEnvironmentAspect *aspect = extraAspect<LocalEnvironmentAspect>();
QTC_ASSERT(aspect, return);
aspect->buildEnvironmentHasChanged(); 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() void DesktopQmakeRunConfiguration::ctor()
{ {
setDefaultDisplayName(defaultDisplayName()); setDefaultDisplayName(defaultDisplayName());
@@ -163,6 +164,8 @@ void DesktopQmakeRunConfiguration::ctor()
QmakeProject *project = static_cast<QmakeProject *>(target()->project()); QmakeProject *project = static_cast<QmakeProject *>(target()->project());
connect(project, &QmakeProject::proFileUpdated, connect(project, &QmakeProject::proFileUpdated,
this, &DesktopQmakeRunConfiguration::proFileUpdated); this, &DesktopQmakeRunConfiguration::proFileUpdated);
connect(project, &QmakeProject::proFilesEvaluated,
this, &DesktopQmakeRunConfiguration::proFileEvaluated);
connect(target(), &Target::kitChanged, connect(target(), &Target::kitChanged,
this, &DesktopQmakeRunConfiguration::kitChanged); this, &DesktopQmakeRunConfiguration::kitChanged);
} }

View File

@@ -107,6 +107,7 @@ signals:
private slots: private slots:
void kitChanged(); void kitChanged();
void proFileUpdated(QmakeProjectManager::QmakeProFileNode *pro, bool success, bool parseInProgress); void proFileUpdated(QmakeProjectManager::QmakeProFileNode *pro, bool success, bool parseInProgress);
void proFileEvaluated();
protected: protected:
DesktopQmakeRunConfiguration(ProjectExplorer::Target *parent, DesktopQmakeRunConfiguration *source); DesktopQmakeRunConfiguration(ProjectExplorer::Target *parent, DesktopQmakeRunConfiguration *source);