forked from qt-creator/qt-creator
QbsProjectManager: Do not reparse the project after every build.
While it is true that additional information about target artifacts can appear during a build, this data is already present in the qbs::Project object and can simply be retrieved. No reparsing is necessary. The exception is when reparsing was requested while the build was going on. In that case, we really need to do it after the build has finished. Change-Id: Ief3797782ad0ca5651974d4b5d3d64e1199ca9a5 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
@@ -101,6 +101,7 @@ QbsProject::QbsProject(QbsManager *manager, const QString &fileName) :
|
||||
m_qbsProjectParser(0),
|
||||
m_qbsUpdateFutureInterface(0),
|
||||
m_forceParsing(false),
|
||||
m_parsingScheduled(false),
|
||||
m_currentBc(0)
|
||||
{
|
||||
m_parsingDelay.setInterval(1000); // delay parsing by 1s.
|
||||
@@ -358,17 +359,14 @@ void QbsProject::readQbsData()
|
||||
qbs::ProjectData data = m_rootProjectNode->qbsProjectData();
|
||||
updateCppCodeModel(data);
|
||||
updateQmlJsCodeModel(data);
|
||||
updateApplicationTargets(data);
|
||||
updateDeploymentInfo(project);
|
||||
|
||||
foreach (Target *t, targets())
|
||||
t->updateDefaultRunConfigurations();
|
||||
updateBuildTargetData();
|
||||
|
||||
emit fileListChanged();
|
||||
}
|
||||
|
||||
void QbsProject::parseCurrentBuildConfiguration(bool force)
|
||||
{
|
||||
m_parsingScheduled = false;
|
||||
if (!m_forceParsing)
|
||||
m_forceParsing = force;
|
||||
|
||||
@@ -380,6 +378,11 @@ void QbsProject::parseCurrentBuildConfiguration(bool force)
|
||||
parse(bc->qbsConfiguration(), bc->environment(), bc->buildDirectory().toString());
|
||||
}
|
||||
|
||||
void QbsProject::updateAfterBuild()
|
||||
{
|
||||
updateBuildTargetData();
|
||||
}
|
||||
|
||||
void QbsProject::registerQbsProjectParser(QbsProjectParser *p)
|
||||
{
|
||||
m_parsingDelay.stop();
|
||||
@@ -647,5 +650,13 @@ void QbsProject::updateDeploymentInfo(const qbs::Project &project)
|
||||
activeTarget()->setDeploymentData(deploymentData);
|
||||
}
|
||||
|
||||
void QbsProject::updateBuildTargetData()
|
||||
{
|
||||
updateApplicationTargets(m_qbsProject.projectData());
|
||||
updateDeploymentInfo(m_qbsProject);
|
||||
foreach (Target *t, targets())
|
||||
t->updateDefaultRunConfigurations();
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace QbsProjectManager
|
||||
|
||||
Reference in New Issue
Block a user