forked from qt-creator/qt-creator
CMake: Fix project parsing notification
This builds on top of 08677c0b01 and
fixes one more code path to go through a common entry/exit point.
Change-Id: I1d00fa9242f247028e5d3b0ef3b5fe1d3f4cb03d
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -200,6 +200,42 @@ QList<ConfigModel::DataItem> ConfigModel::configurationChanges() const
|
||||
});
|
||||
}
|
||||
|
||||
void ConfigModel::setConfiguration(const CMakeConfig &config)
|
||||
{
|
||||
setConfiguration(Utils::transform(config, [](const CMakeConfigItem &i) {
|
||||
ConfigModel::DataItem j;
|
||||
j.key = QString::fromUtf8(i.key);
|
||||
j.value = QString::fromUtf8(i.value);
|
||||
j.description = QString::fromUtf8(i.documentation);
|
||||
j.values = i.values;
|
||||
j.inCMakeCache = i.inCMakeCache;
|
||||
|
||||
j.isAdvanced = i.isAdvanced;
|
||||
j.isHidden = i.type == CMakeConfigItem::INTERNAL || i.type == CMakeConfigItem::STATIC;
|
||||
|
||||
switch (i.type) {
|
||||
case CMakeConfigItem::FILEPATH:
|
||||
j.type = ConfigModel::DataItem::FILE;
|
||||
break;
|
||||
case CMakeConfigItem::PATH:
|
||||
j.type = ConfigModel::DataItem::DIRECTORY;
|
||||
break;
|
||||
case CMakeConfigItem::BOOL:
|
||||
j.type = ConfigModel::DataItem::BOOLEAN;
|
||||
break;
|
||||
case CMakeConfigItem::STRING:
|
||||
j.type = ConfigModel::DataItem::STRING;
|
||||
break;
|
||||
default:
|
||||
j.type = ConfigModel::DataItem::UNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
return j;
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
void ConfigModel::setConfiguration(const QList<ConfigModel::InternalDataItem> &config)
|
||||
{
|
||||
QList<InternalDataItem> tmp = config;
|
||||
|
||||
Reference in New Issue
Block a user