summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@theqtcompany.com>2015-09-28 16:27:54 +0200
committerTobias Hunger <tobias.hunger@theqtcompany.com>2015-09-28 15:10:13 +0000
commit803cca408665a54b8b9ed2e0a651b9c82b95ad80 (patch)
treedef9ab7bda27004723fccd027f261ac8351f6f6c
parent10859951a28208cb49b7fb6f6508bca935966e8a (diff)
downloadqt-creator-803cca408665a54b8b9ed2e0a651b9c82b95ad80.tar.gz
Qbs: Send fileListChanged signal later
Only send the fileListChanged signal at a point where the files() method will actually return a non-empty list of files. This fixes one reported issue with the Qbs project, but should actually fix more than that: The files() list is used in several places. Task-number: QTCREATORBUG-15112 Change-Id: I2c8207dccfb70d79f50eb65caba88b1a6a11a071 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
-rw-r--r--src/plugins/qbsprojectmanager/qbsproject.cpp32
-rw-r--r--src/plugins/qbsprojectmanager/qbsproject.h1
2 files changed, 14 insertions, 19 deletions
diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp
index e58d5e84f4..78ee6de535 100644
--- a/src/plugins/qbsprojectmanager/qbsproject.cpp
+++ b/src/plugins/qbsprojectmanager/qbsproject.cpp
@@ -454,13 +454,19 @@ void QbsProject::handleQbsParsingDone(bool success)
generateErrors(m_qbsProjectParser->error());
+ bool dataChanged = false;
if (success) {
m_qbsProject = m_qbsProjectParser->qbsProject();
const qbs::ProjectData &projectData = m_qbsProject.projectData();
QTC_CHECK(m_qbsProject.isValid());
+
if (projectData != m_projectData) {
m_projectData = projectData;
- readQbsData();
+ m_rootProjectNode->update();
+
+ updateDocuments(m_qbsProject.isValid()
+ ? m_qbsProject.buildSystemFiles() : QSet<QString>() << m_fileName);
+ dataChanged = true;
}
} else {
m_qbsUpdateFutureInterface->reportCanceled();
@@ -475,6 +481,13 @@ void QbsProject::handleQbsParsingDone(bool success)
m_qbsUpdateFutureInterface = 0;
}
+ if (dataChanged) { // Do this now when isParsing() is false!
+ updateCppCodeModel();
+ updateQmlJsCodeModel();
+ updateBuildTargetData();
+
+ emit fileListChanged();
+ }
emit projectParsingDone(success);
}
@@ -524,23 +537,6 @@ void QbsProject::delayParsing()
m_parsingDelay.start();
}
-// Qbs may change its data
-void QbsProject::readQbsData()
-{
- QTC_ASSERT(m_rootProjectNode, return);
-
- m_rootProjectNode->update();
-
- updateDocuments(m_qbsProject.isValid()
- ? m_qbsProject.buildSystemFiles() : QSet<QString>() << m_fileName);
-
- updateCppCodeModel();
- updateQmlJsCodeModel();
- updateBuildTargetData();
-
- emit fileListChanged();
-}
-
void QbsProject::parseCurrentBuildConfiguration()
{
m_parsingScheduled = false;
diff --git a/src/plugins/qbsprojectmanager/qbsproject.h b/src/plugins/qbsprojectmanager/qbsproject.h
index 3ab050f827..f46d7b8e2e 100644
--- a/src/plugins/qbsprojectmanager/qbsproject.h
+++ b/src/plugins/qbsprojectmanager/qbsproject.h
@@ -114,7 +114,6 @@ public:
public slots:
void invalidate();
void delayParsing();
- void readQbsData();
signals:
void projectParsingStarted();