forked from qt-creator/qt-creator
QbsProjectManager: Run updateAfterParse() also on add/remove file
Adding and removing files via the project tree is essentially the same thing as doing it by editing a project file, except that no reparsing is necessary. Task-number: QTCREATORBUG-19292 Change-Id: Idb1bcf0e183f34d4de513f69f974e45ac91afeeb Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -275,7 +275,7 @@ bool QbsProject::addFilesToProduct(const QStringList &filePaths,
|
|||||||
}
|
}
|
||||||
if (notAdded->count() != filePaths.count()) {
|
if (notAdded->count() != filePaths.count()) {
|
||||||
m_projectData = m_qbsProject.projectData();
|
m_projectData = m_qbsProject.projectData();
|
||||||
rebuildProjectTree();
|
delayedUpdateAfterParse();
|
||||||
}
|
}
|
||||||
return notAdded->isEmpty();
|
return notAdded->isEmpty();
|
||||||
}
|
}
|
||||||
@@ -302,8 +302,7 @@ bool QbsProject::removeFilesFromProduct(const QStringList &filePaths,
|
|||||||
}
|
}
|
||||||
if (notRemoved->count() != filePaths.count()) {
|
if (notRemoved->count() != filePaths.count()) {
|
||||||
m_projectData = m_qbsProject.projectData();
|
m_projectData = m_qbsProject.projectData();
|
||||||
rebuildProjectTree();
|
delayedUpdateAfterParse();
|
||||||
emit fileListChanged();
|
|
||||||
}
|
}
|
||||||
return notRemoved->isEmpty();
|
return notRemoved->isEmpty();
|
||||||
}
|
}
|
||||||
@@ -472,6 +471,11 @@ void QbsProject::updateAfterParse()
|
|||||||
emit fileListChanged();
|
emit fileListChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QbsProject::delayedUpdateAfterParse()
|
||||||
|
{
|
||||||
|
QTimer::singleShot(0, this, &QbsProject::updateAfterParse);
|
||||||
|
}
|
||||||
|
|
||||||
void QbsProject::updateProjectNodes()
|
void QbsProject::updateProjectNodes()
|
||||||
{
|
{
|
||||||
OpTimer opTimer("updateProjectNodes");
|
OpTimer opTimer("updateProjectNodes");
|
||||||
|
@@ -136,6 +136,7 @@ private:
|
|||||||
void handleRuleExecutionDone();
|
void handleRuleExecutionDone();
|
||||||
bool checkCancelStatus();
|
bool checkCancelStatus();
|
||||||
void updateAfterParse();
|
void updateAfterParse();
|
||||||
|
void delayedUpdateAfterParse();
|
||||||
void updateProjectNodes();
|
void updateProjectNodes();
|
||||||
|
|
||||||
void projectLoaded() override;
|
void projectLoaded() override;
|
||||||
|
Reference in New Issue
Block a user