CMakePM: Use UNINITIALIZED for -D<var>=<val> in Batch Edit

CMake is setting the UNINITIALIZED type if you forget to set the
type of a variable when you do it from command line.

Qt Creator was setting INTERNAL, which had the effect of not
being displayed in the UI at all, giving the impression that the
value has been dropped.

Change-Id: I9a6b487bf5062d288365938fd7ef99b49de42884
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Cristian Adam
2021-03-03 18:07:56 +01:00
parent ffb19f9acf
commit 6fa671b329
4 changed files with 13 additions and 6 deletions

View File

@@ -145,9 +145,11 @@ CMakeConfigItem::Type CMakeConfigItem::typeStringToType(const QByteArray &type)
return CMakeConfigItem::PATH;
if (type == "STATIC")
return CMakeConfigItem::STATIC;
if (type == "INTERNAL")
return CMakeConfigItem::INTERNAL;
QTC_CHECK(type == "INTERNAL" || type == "UNINITIALIZED");
return CMakeConfigItem::INTERNAL;
QTC_CHECK(type == "UNINITIALIZED");
return CMakeConfigItem::UNINITIALIZED;
}
QString CMakeConfigItem::typeToTypeString(const CMakeConfigItem::Type t)
@@ -163,8 +165,10 @@ QString CMakeConfigItem::typeToTypeString(const CMakeConfigItem::Type t)
return {"INTERNAL"};
case CMakeProjectManager::CMakeConfigItem::STATIC:
return {"STATIC"};
case CMakeConfigItem::BOOL:
case CMakeProjectManager::CMakeConfigItem::BOOL:
return {"BOOL"};
case CMakeProjectManager::CMakeConfigItem::UNINITIALIZED:
return {"UNINITIALIZED"};
}
QTC_CHECK(false);
return {};
@@ -418,6 +422,9 @@ QString CMakeConfigItem::toString(const Utils::MacroExpander *expander) const
case CMakeProjectManager::CMakeConfigItem::INTERNAL:
typeStr = QLatin1String("INTERNAL");
break;
case CMakeProjectManager::CMakeConfigItem::UNINITIALIZED:
typeStr = QLatin1String("UNINITIALIZED");
break;
case CMakeProjectManager::CMakeConfigItem::STRING:
default:
typeStr = QLatin1String("STRING");