forked from qt-creator/qt-creator
ProjectExplorer: avoid workspace project rescan on unchanged filters
Changing the project name or run configuration in the project file should not trigger a full parsing of the workspace project. Only if the exclude filters are changed we need to rebuild the project tree. Change-Id: I0f537f14aa1055eee2f03444209479a65b8115e7 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -61,6 +61,7 @@ class WorkspaceBuildSystem final : public BuildSystem
|
|||||||
public:
|
public:
|
||||||
WorkspaceBuildSystem(Target *t);
|
WorkspaceBuildSystem(Target *t);
|
||||||
|
|
||||||
|
void reparse(bool force);
|
||||||
void triggerParsing() final;
|
void triggerParsing() final;
|
||||||
|
|
||||||
void watchFolder(const FilePath &path, const QList<IVersionControl *> &versionControls);
|
void watchFolder(const FilePath &path, const QList<IVersionControl *> &versionControls);
|
||||||
@@ -152,8 +153,9 @@ WorkspaceBuildSystem::WorkspaceBuildSystem(Target *t)
|
|||||||
requestDelayedParse();
|
requestDelayedParse();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorkspaceBuildSystem::triggerParsing()
|
void WorkspaceBuildSystem::reparse(bool force)
|
||||||
{
|
{
|
||||||
|
const QList<QRegularExpression> oldFilters = m_filters;
|
||||||
m_filters.clear();
|
m_filters.clear();
|
||||||
FilePath projectPath = project()->projectDirectory();
|
FilePath projectPath = project()->projectDirectory();
|
||||||
|
|
||||||
@@ -211,7 +213,13 @@ void WorkspaceBuildSystem::triggerParsing()
|
|||||||
|
|
||||||
setApplicationTargets(targetInfos);
|
setApplicationTargets(targetInfos);
|
||||||
|
|
||||||
scan(target()->project()->projectDirectory());
|
if (force || oldFilters != m_filters)
|
||||||
|
scan(target()->project()->projectDirectory());
|
||||||
|
}
|
||||||
|
|
||||||
|
void WorkspaceBuildSystem::triggerParsing()
|
||||||
|
{
|
||||||
|
reparse(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorkspaceBuildSystem::watchFolder(
|
void WorkspaceBuildSystem::watchFolder(
|
||||||
@@ -518,8 +526,8 @@ void setupWorkspaceProject(QObject *guard)
|
|||||||
const auto project = qobject_cast<WorkspaceProject *>(node->getProject());
|
const auto project = qobject_cast<WorkspaceProject *>(node->getProject());
|
||||||
QTC_ASSERT(project, return);
|
QTC_ASSERT(project, return);
|
||||||
if (auto target = project->activeTarget()) {
|
if (auto target = project->activeTarget()) {
|
||||||
if (target->buildSystem())
|
if (auto buildSystem = dynamic_cast<WorkspaceBuildSystem *>(target->buildSystem()))
|
||||||
target->buildSystem()->triggerParsing();
|
buildSystem->reparse(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user