forked from qt-creator/qt-creator
QbsProjectManager: Fix reparsing after switching build configurations
After switching to a different build configuration, property changes in
the build config widget would no longer cause project reparsing. Likely
caused by e52ebbf217
.
Change-Id: Ifebec74475def49885232ad71d4de01f51568fcb
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -125,7 +125,6 @@ QbsProject::QbsProject(const FileName &fileName) :
|
||||
m_parsingScheduled(false),
|
||||
m_cancelStatus(CancelStatusNone),
|
||||
m_cppCodeModelUpdater(new CppTools::CppProjectUpdater(this)),
|
||||
m_currentBc(0),
|
||||
m_extraCompilersPending(false)
|
||||
{
|
||||
m_parsingDelay.setInterval(1000); // delay parsing by 1s.
|
||||
@@ -148,6 +147,7 @@ QbsProject::QbsProject(const FileName &fileName) :
|
||||
};
|
||||
subscribeSignal(&BuildConfiguration::environmentChanged, this, delayedParsing);
|
||||
subscribeSignal(&BuildConfiguration::buildDirectoryChanged, this, delayedParsing);
|
||||
subscribeSignal(&QbsBuildConfiguration::qbsConfigurationChanged, this, delayedParsing);
|
||||
subscribeSignal(&Target::activeBuildConfigurationChanged, this, delayedParsing);
|
||||
|
||||
connect(&m_parsingDelay, &QTimer::timeout, this, &QbsProject::startParsing);
|
||||
@@ -338,11 +338,6 @@ bool QbsProject::renameFileInProduct(const QString &oldPath, const QString &newP
|
||||
return addFilesToProduct(QStringList() << newPath, newProductData, newGroupData, &dummy);
|
||||
}
|
||||
|
||||
void QbsProject::invalidate()
|
||||
{
|
||||
prepareForParsing();
|
||||
}
|
||||
|
||||
static qbs::AbstractJob *doBuildOrClean(const qbs::Project &project,
|
||||
const QList<qbs::ProductData> &products,
|
||||
const qbs::BuildOptions &options)
|
||||
@@ -546,29 +541,8 @@ void QbsProject::handleRuleExecutionDone()
|
||||
|
||||
void QbsProject::changeActiveTarget(Target *t)
|
||||
{
|
||||
BuildConfiguration *bc = 0;
|
||||
if (t) {
|
||||
if (t)
|
||||
m_qbsProject = m_qbsProjects.value(t);
|
||||
if (t->kit())
|
||||
bc = t->activeBuildConfiguration();
|
||||
}
|
||||
buildConfigurationChanged(bc);
|
||||
}
|
||||
|
||||
void QbsProject::buildConfigurationChanged(BuildConfiguration *bc)
|
||||
{
|
||||
if (m_currentBc)
|
||||
disconnect(m_currentBc, &QbsBuildConfiguration::qbsConfigurationChanged,
|
||||
this, &QbsProject::delayParsing);
|
||||
|
||||
m_currentBc = qobject_cast<QbsBuildConfiguration *>(bc);
|
||||
if (m_currentBc) {
|
||||
connect(m_currentBc, &QbsBuildConfiguration::qbsConfigurationChanged,
|
||||
this, &QbsProject::delayParsing);
|
||||
delayParsing();
|
||||
} else {
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
void QbsProject::startParsing()
|
||||
|
@@ -110,7 +110,6 @@ public:
|
||||
|
||||
void configureAsExampleProject(const QSet<Core::Id> &platforms) final;
|
||||
|
||||
void invalidate();
|
||||
void delayParsing();
|
||||
|
||||
private:
|
||||
@@ -119,7 +118,6 @@ private:
|
||||
void rebuildProjectTree();
|
||||
|
||||
void changeActiveTarget(ProjectExplorer::Target *t);
|
||||
void buildConfigurationChanged(ProjectExplorer::BuildConfiguration *bc);
|
||||
void startParsing();
|
||||
|
||||
void parse(const QVariantMap &config, const Utils::Environment &env, const QString &dir,
|
||||
@@ -168,7 +166,6 @@ private:
|
||||
CppTools::CppProjectUpdater *m_cppCodeModelUpdater = nullptr;
|
||||
CppTools::ProjectInfo m_cppCodeModelProjectInfo;
|
||||
|
||||
QbsBuildConfiguration *m_currentBc;
|
||||
mutable ProjectExplorer::ProjectImporter *m_importer = nullptr;
|
||||
|
||||
QTimer m_parsingDelay;
|
||||
|
Reference in New Issue
Block a user