Commit 803cca40 authored by Tobias Hunger's avatar Tobias Hunger

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: default avatarChristian Kandeler <christian.kandeler@theqtcompany.com>
parent 10859951
......@@ -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;
......
......@@ -114,7 +114,6 @@ public:
public slots:
void invalidate();
void delayParsing();
void readQbsData();
signals:
void projectParsingStarted();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment