From 4ba957f9d83f79c8667e987257c5626d8ad7c496 Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Sun, 6 Mar 2022 03:55:54 +0200 Subject: [PATCH] Remove "Device" keyword from platform device name QC uses the display name set in IDeviceFactory to refer to the platform name. However, the display name usually have the "Device" keyword at the end because it's coming form the IDeviceFactory. That would work fine for example in new device creation dialog. But QC is using that in other places like new file/project wizard to show the supported platform for a project, and that's where having "Device" seems unnecessary or wrong. This fixes that behavior, but removing that keyword when calling KitFeatureProvider::displayNameForPlatform(). Change-Id: I5fd4bbcb1ec2579f8b7e86226a7d50b6d7807382 Reviewed-by: Alessandro Portale --- src/plugins/projectexplorer/kitmanager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 52cf506a885..e67bbe71d25 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -813,7 +813,10 @@ QSet KitFeatureProvider::availablePlatforms() const QString KitFeatureProvider::displayNameForPlatform(Id id) const { if (IDeviceFactory *f = IDeviceFactory::find(id)) { - const QString dn = f->displayName(); + QString dn = f->displayName(); + const QString deviceStr = QStringLiteral("device"); + if (dn.endsWith(deviceStr, Qt::CaseInsensitive)) + dn = dn.remove(deviceStr, Qt::CaseInsensitive).trimmed(); QTC_CHECK(!dn.isEmpty()); return dn; }