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());
|
generateErrors(m_qbsProjectParser->error());
|
||||||
|
|
||||||
|
bool dataChanged = false;
|
||||||
if (success) {
|
if (success) {
|
||||||
m_qbsProject = m_qbsProjectParser->qbsProject();
|
m_qbsProject = m_qbsProjectParser->qbsProject();
|
||||||
const qbs::ProjectData &projectData = m_qbsProject.projectData();
|
const qbs::ProjectData &projectData = m_qbsProject.projectData();
|
||||||
QTC_CHECK(m_qbsProject.isValid());
|
QTC_CHECK(m_qbsProject.isValid());
|
||||||
|
|
||||||
if (projectData != m_projectData) {
|
if (projectData != m_projectData) {
|
||||||
m_projectData = projectData;
|
m_projectData = projectData;
|
||||||
readQbsData();
|
m_rootProjectNode->update();
|
||||||
|
|
||||||
|
updateDocuments(m_qbsProject.isValid()
|
||||||
|
? m_qbsProject.buildSystemFiles() : QSet<QString>() << m_fileName);
|
||||||
|
dataChanged = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
m_qbsUpdateFutureInterface->reportCanceled();
|
m_qbsUpdateFutureInterface->reportCanceled();
|
||||||
@@ -475,6 +481,13 @@ void QbsProject::handleQbsParsingDone(bool success)
|
|||||||
m_qbsUpdateFutureInterface = 0;
|
m_qbsUpdateFutureInterface = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dataChanged) { // Do this now when isParsing() is false!
|
||||||
|
updateCppCodeModel();
|
||||||
|
updateQmlJsCodeModel();
|
||||||
|
updateBuildTargetData();
|
||||||
|
|
||||||
|
emit fileListChanged();
|
||||||
|
}
|
||||||
emit projectParsingDone(success);
|
emit projectParsingDone(success);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -524,23 +537,6 @@ void QbsProject::delayParsing()
|
|||||||
m_parsingDelay.start();
|
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()
|
void QbsProject::parseCurrentBuildConfiguration()
|
||||||
{
|
{
|
||||||
m_parsingScheduled = false;
|
m_parsingScheduled = false;
|
||||||
|
|||||||
@@ -114,7 +114,6 @@ public:
|
|||||||
public slots:
|
public slots:
|
||||||
void invalidate();
|
void invalidate();
|
||||||
void delayParsing();
|
void delayParsing();
|
||||||
void readQbsData();
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void projectParsingStarted();
|
void projectParsingStarted();
|
||||||
|
|||||||
Reference in New Issue
Block a user