aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@digia.com>2014-03-03 17:23:41 +0100
committerTobias Hunger <tobias.hunger@digia.com>2014-03-03 17:37:37 +0100
commit158fa9c487da375dece883d9f499d7f22b060fa7 (patch)
tree5654dcea6a8a7868cdcd54d07d6842bb7b859d64
parent321f67ffeb0d033f58666e0071ffa315aa8072c6 (diff)
Qbs: Wait for reparsing to be done after a build
This is necessary since the build may change the the properties of the build targets (executable name, etc.), so we can not proceed to run anything without that update. Change-Id: I9790c529db5e4da61f59e638a05339ada714353c Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
-rw-r--r--src/plugins/qbsprojectmanager/qbsbuildstep.cpp14
-rw-r--r--src/plugins/qbsprojectmanager/qbsbuildstep.h2
2 files changed, 14 insertions, 2 deletions
diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp
index 678e4f15f0..4ac5f4721e 100644
--- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp
+++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp
@@ -234,16 +234,26 @@ QVariantMap QbsBuildStep::toMap() const
void QbsBuildStep::buildingDone(bool success)
{
+ m_lastWasSuccess = success;
// Report errors:
foreach (const qbs::ErrorItem &item, m_job->error().items())
createTaskAndOutput(ProjectExplorer::Task::Error, item.description(),
item.codeLocation().fileName(), item.codeLocation().line());
+ QbsProject *pro = static_cast<QbsProject *>(project());
+ connect(pro, SIGNAL(projectParsingDone(bool)), this, SLOT(reparsingDone()));
+
// Building can uncover additional target artifacts.
- static_cast<QbsProject *>(project())->parseCurrentBuildConfiguration(true);
+ // Wait for reparsing to finish, since before that our run configurations may not be valid.
+ pro->parseCurrentBuildConfiguration(true);
+}
+void QbsBuildStep::reparsingDone()
+{
+ disconnect(static_cast<QbsProject *>(project()), SIGNAL(projectParsingDone(bool)),
+ this, SLOT(reparsingDone()));
QTC_ASSERT(m_fi, return);
- m_fi->reportResult(success);
+ m_fi->reportResult(m_lastWasSuccess);
m_fi = 0; // do not delete, it is not ours
m_job->deleteLater();
m_job = 0;
diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.h b/src/plugins/qbsprojectmanager/qbsbuildstep.h
index 3b6ceb77c2..9c576b7a46 100644
--- a/src/plugins/qbsprojectmanager/qbsbuildstep.h
+++ b/src/plugins/qbsprojectmanager/qbsbuildstep.h
@@ -80,6 +80,7 @@ signals:
private slots:
void buildingDone(bool success);
+ void reparsingDone();
void handleTaskStarted(const QString &desciption, int max);
void handleProgress(int value);
void handleCommandDescriptionReport(const QString &highlight, const QString &message);
@@ -108,6 +109,7 @@ private:
QFutureInterface<bool> *m_fi;
qbs::BuildJob *m_job;
int m_progressBase;
+ bool m_lastWasSuccess;
ProjectExplorer::IOutputParser *m_parser;
friend class QbsBuildStepConfigWidget;