forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user