forked from qt-creator/qt-creator
CMakePM: Fix reading ninjaPath from QtCreator.ini
For the special case when the Qt SDK Installer appends the same path to the key. Task-number: QTBUG-115754 Change-Id: I87d8f3d8074044f440ed3042bc5fe8356a6c429c Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -61,6 +61,12 @@ CMakeSpecificSettings::CMakeSpecificSettings()
|
||||
// never save this to the settings:
|
||||
ninjaPath.setToSettingsTransformation(
|
||||
[](const QVariant &) { return QVariant::fromValue(QString()); });
|
||||
ninjaPath.setFromSettingsTransformation([](const QVariant &from) {
|
||||
// Sometimes the installer appends the same ninja path to the qtcreator.ini file
|
||||
const QString path = from.canConvert<QStringList>() ? from.toStringList().last()
|
||||
: from.toString();
|
||||
return FilePath::fromUserInput(path).toVariant();
|
||||
});
|
||||
|
||||
packageManagerAutoSetup.setSettingsKey("PackageManagerAutoSetup");
|
||||
packageManagerAutoSetup.setDefaultValue(true);
|
||||
|
Reference in New Issue
Block a user