diff options
author | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2022-03-06 03:55:54 +0200 |
---|---|---|
committer | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2022-03-08 10:57:49 +0000 |
commit | 4ba957f9d83f79c8667e987257c5626d8ad7c496 (patch) | |
tree | f31636df284c10969a735dd053dbd18945781e8e | |
parent | 0f6e9f7146ffd9f7caade563abf8bd5c60bedcc3 (diff) |
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 <alessandro.portale@qt.io>
-rw-r--r-- | src/plugins/projectexplorer/kitmanager.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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<Id> 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; } |