From 612529f2a7be5c5b6f6e0c32b999ec9ec7cf33a0 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Wed, 2 Feb 2022 19:32:02 +0100 Subject: [PATCH] CMakePM: Update generator label in Kit's CMake settings Now only the parts of the generator that have a value are displayed. Previously the label had "" for the missing values. Change-Id: I666bd04c94c47410ee71912dc0cebbcc6c6c79d2 Reviewed-by: Reviewed-by: Alessandro Portale --- .../cmakekitinformation.cpp | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp index 2fdb16e31f3..33224d439d1 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp @@ -396,12 +396,18 @@ private: const QString platform = CMakeGeneratorKitAspect::platform(kit()); const QString toolset = CMakeGeneratorKitAspect::toolset(kit()); - const QString message = tr("%1 - %2, Platform: %3, Toolset: %4") - .arg(extraGenerator.isEmpty() ? tr("") : extraGenerator) - .arg(generator.isEmpty() ? tr("") : generator) - .arg(platform.isEmpty() ? tr("") : platform) - .arg(toolset.isEmpty() ? tr("") : toolset); - m_label->setText(message); + QStringList messageLabel; + if (!extraGenerator.isEmpty()) + messageLabel << extraGenerator << " - "; + + messageLabel << generator; + + if (!platform.isEmpty()) + messageLabel << ", " << tr("Platform") << ": " << platform; + if (!toolset.isEmpty()) + messageLabel << ", " << tr("Toolset") << ": " << toolset; + + m_label->setText(messageLabel.join("")); } void changeGenerator() @@ -495,6 +501,8 @@ private: extraGeneratorCombo->currentData().toString(), platformEdit->isEnabled() ? platformEdit->text() : QString(), toolsetEdit->isEnabled() ? toolsetEdit->text() : QString()); + + refresh(); } }