From 28dbc1cf0abe9f3b082ac6feead62ae6a315393e Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Mon, 17 Feb 2025 16:25:12 +0100 Subject: [PATCH] CMakePM: PE: Hide (imported) suffix for buildtype names Amends 67d22995968c99ab815d1499bc500c2f74187775 CMake Presets are implemented on top of build import functionality in Qt Creator, since this can create kits / compilers etc. But these build imports are artificial and should not be marked as (imported) since this is something that Qt Creator does and not done by the users. Change-Id: I2ddf75d6fb3e4726f45b7431cacafc65f89bc39d Reviewed-by: Christian Kandeler --- src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp | 3 +++ src/plugins/projectexplorer/projectimporter.cpp | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp index 7d74a891eeb..224a2382d85 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp @@ -1227,6 +1227,9 @@ const QList CMakeProjectImporter::buildInfoList(void *directoryData) config.insert(Constants::QML_DEBUG_SETTING, data->hasQmlDebugging ? TriState::Enabled.toVariant() : TriState::Default.toVariant()); + if (!data->cmakePreset.isEmpty()) + config["hideImportedSuffix"] = true; + info.extraInfo = config; qCDebug(cmInputLog) << "BuildInfo configured."; diff --git a/src/plugins/projectexplorer/projectimporter.cpp b/src/plugins/projectexplorer/projectimporter.cpp index 01a4e99b652..ef80a7585f9 100644 --- a/src/plugins/projectexplorer/projectimporter.cpp +++ b/src/plugins/projectexplorer/projectimporter.cpp @@ -143,7 +143,9 @@ const QList ProjectImporter::import(const Utils::FilePath &importPath continue; } for (BuildInfo i : infoList) { - i.displayName = Tr::tr("%1 (imported)").arg(i.displayName); + const QVariantMap extraInfo = i.extraInfo.toMap(); + if (!extraInfo["hideImportedSuffix"].toBool()) + i.displayName = Tr::tr("%1 (imported)").arg(i.displayName); i.kitId = k->id(); i.factory = factory; if (!result.contains(i))