From 037ab39cb8e77e7b8d33cb76559c52dc6b1a4c3f Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 8 Feb 2019 13:35:55 +0100 Subject: [PATCH] Fix cloning DesktopQmakeRunConfiguration The value of a terminal aspect is not exported in toMap() unless it was set by the user, so we need help from the project manager to get the default value. The QbsRunConfiguration already works this way. Maybe the terminal aspect could export all of its information and we could drop the fromMap() override from both run configs, but that should be a different patch. Fixes: QTCREATORBUG-21918 Change-Id: I712158f4bcb4dbd3827568dd4e1fe8b21d802f47 Reviewed-by: Orgad Shaneh --- .../qmakeprojectmanager/desktopqmakerunconfiguration.cpp | 8 ++++++++ .../qmakeprojectmanager/desktopqmakerunconfiguration.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp b/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp index 385fd54b3d0..8ac2a1cd0b5 100644 --- a/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp @@ -105,6 +105,14 @@ void DesktopQmakeRunConfiguration::updateTargetInformation() aspect()->setExecutable(bti.targetFilePath); } +bool DesktopQmakeRunConfiguration::fromMap(const QVariantMap &map) +{ + if (!RunConfiguration::fromMap(map)) + return false; + updateTargetInformation(); + return true; +} + void DesktopQmakeRunConfiguration::doAdditionalSetup(const RunConfigurationCreationInfo &) { updateTargetInformation(); diff --git a/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.h b/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.h index ecaa1bfc6b8..2a4ccd564ba 100644 --- a/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.h +++ b/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.h @@ -43,6 +43,7 @@ public: private: void updateTargetInformation(); + bool fromMap(const QVariantMap &map) final; void doAdditionalSetup(const ProjectExplorer::RunConfigurationCreationInfo &info) final; QString defaultDisplayName();