From 38c8e200710eb1c452705f2451e4f6260b3309fa Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 20 Oct 2022 15:35:38 +0200 Subject: [PATCH] QMake: Remove unnecessary build dir changed Previously every time a qmake project was built, the "buildDirectoryChanged()" was emitted, leading to a complete reparse of the project file, tests, qml files and qml imports. To keep "QmakeBuildConfiguration::updateProblemLabel" be called, we re-introduce the "buildDirectoryInitialized" signal. Task-number: QTCREATORBUG-27785 Change-Id: I32d881eacb8cf26050c33da643c74c2cab4dc22d Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/buildconfiguration.h | 1 + src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp | 2 ++ src/plugins/qmakeprojectmanager/qmakestep.cpp | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/buildconfiguration.h b/src/plugins/projectexplorer/buildconfiguration.h index 59649e5defc..815daeda6bf 100644 --- a/src/plugins/projectexplorer/buildconfiguration.h +++ b/src/plugins/projectexplorer/buildconfiguration.h @@ -116,6 +116,7 @@ public: signals: void environmentChanged(); + void buildDirectoryInitialized(); void buildDirectoryChanged(); void enabledChanged(); void buildTypeChanged(); diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp index 899ed4e4a4f..c1cb54d3e12 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp @@ -153,6 +153,8 @@ QmakeBuildConfiguration::QmakeBuildConfiguration(Target *target, Id id) }); buildDirectoryAspect()->allowInSourceBuilds(target->project()->projectDirectory()); + connect(this, &BuildConfiguration::buildDirectoryInitialized, + this, &QmakeBuildConfiguration::updateProblemLabel); connect(this, &BuildConfiguration::buildDirectoryChanged, this, &QmakeBuildConfiguration::updateProblemLabel); connect(this, &QmakeBuildConfiguration::qmakeBuildConfigurationChanged, diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index f29e0abb64b..0a075eb3234 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -306,7 +306,7 @@ bool QMakeStep::processSucceeded(int exitCode, QProcess::ExitStatus status) bool result = AbstractProcessStep::processSucceeded(exitCode, status); if (!result) m_needToRunQMake = true; - emit buildConfiguration()->buildDirectoryChanged(); + emit buildConfiguration()->buildDirectoryInitialized(); return result; }