forked from qt-creator/qt-creator
sdktool: Do not fiddle with display names
sdktool made the "display names" unique by potentially adding a number. This has multiple drawbacks: - The display name can contain variables that lead to unique _expanded_ names - Adding a number doesn't really help for distinguishing things - That number is then hard-baked into the install settings Installers should take care that they register identifiable names. And if we really want to ensure unique names, then Qt Creator can do that itself, or even better leave the user to do it, because a number doesn't really help anyhow. Fixes: QTCREATORBUG-17909 Change-Id: Id0f44c0cbe457047a0713bda4980fb5d4bc5bcaa Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -623,19 +623,12 @@ QVariantMap AddKitOperation::addKit(const QVariantMap &map, const QVariantMap &t
|
||||
// remove data:
|
||||
QVariantMap cleaned = RmKeysOperation::rmKeys(map, {COUNT, DEFAULT});
|
||||
|
||||
// Sanity check: Make sure displayName is unique.
|
||||
QStringList nameKeys = FindKeyOperation::findKey(map, DISPLAYNAME);
|
||||
QStringList nameList;
|
||||
foreach (const QString &nameKey, nameKeys)
|
||||
nameList << GetOperation::get(map, nameKey).toString();
|
||||
const QString uniqueName = makeUnique(displayName, nameList);
|
||||
|
||||
// insert data:
|
||||
KeyValuePairList data = { KeyValuePair({kit, ID}, QVariant(id)),
|
||||
KeyValuePair({kit, DISPLAYNAME}, QVariant(uniqueName)),
|
||||
KeyValuePair({kit, ICON}, QVariant(icon)),
|
||||
KeyValuePair({kit, AUTODETECTED}, QVariant(true)),
|
||||
KeyValuePair({kit, SDK}, QVariant(true))};
|
||||
KeyValuePairList data = {KeyValuePair({kit, ID}, QVariant(id)),
|
||||
KeyValuePair({kit, DISPLAYNAME}, QVariant(displayName)),
|
||||
KeyValuePair({kit, ICON}, QVariant(icon)),
|
||||
KeyValuePair({kit, AUTODETECTED}, QVariant(true)),
|
||||
KeyValuePair({kit, SDK}, QVariant(true))};
|
||||
|
||||
if (!debuggerId.isEmpty() || !debugger.isEmpty()) {
|
||||
if (debuggerId.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user