From e54cbc69d82f387ee777de04843635d85693eaa8 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 17 Aug 2021 14:10:52 +0200 Subject: [PATCH] RemoteLinux: Fix updating of command line for temporary local install E.g. in case of CMake projects the command contains the build directory, so it needs to update whenever the build directory (or build configuration) changes. Fixes: QTCREATORBUG-26103 Change-Id: I02ea3bd47f4a502adc485dfffbed6a14ebefb0bb Reviewed-by: Christian Kandeler --- src/plugins/remotelinux/makeinstallstep.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/plugins/remotelinux/makeinstallstep.cpp b/src/plugins/remotelinux/makeinstallstep.cpp index 7f3a880c4eb..5321683e4f0 100644 --- a/src/plugins/remotelinux/makeinstallstep.cpp +++ b/src/plugins/remotelinux/makeinstallstep.cpp @@ -103,15 +103,17 @@ MakeInstallStep::MakeInstallStep(BuildStepList *parent, Utils::Id id) : MakeStep customCommandLineAspect->makeCheckable(StringAspect::CheckBoxPlacement::Top, tr("Use custom command line instead:"), "RemoteLinux.MakeInstall.EnableCustomCommandLine"); - connect(customCommandLineAspect, &StringAspect::checkedChanged, - this, &MakeInstallStep::updateCommandFromAspect); - connect(customCommandLineAspect, &StringAspect::checkedChanged, - this, &MakeInstallStep::updateArgsFromAspect); - connect(customCommandLineAspect, &StringAspect::checkedChanged, - this, &MakeInstallStep::updateFromCustomCommandLineAspect); + const auto updateCommand = [this] { + updateCommandFromAspect(); + updateArgsFromAspect(); + updateFromCustomCommandLineAspect(); + }; + connect(customCommandLineAspect, &StringAspect::checkedChanged, this, updateCommand); connect(customCommandLineAspect, &StringAspect::changed, this, &MakeInstallStep::updateFromCustomCommandLineAspect); + connect(target(), &Target::buildSystemUpdated, this, updateCommand); + QTemporaryDir tmpDir; installRootAspect->setFilePath(FilePath::fromString(tmpDir.path())); const MakeInstallCommand cmd = target()->makeInstallCommand(tmpDir.path());