| 32 | : SettingMeta(layer, key, setting_type) {} |
| 33 | |
| 34 | bool SettingMetaEnumeration::Load(const QJsonObject& json_setting) { |
| 35 | const QJsonArray& json_array_flags = ReadArray(json_setting, "flags"); |
| 36 | for (int i = 0, n = json_array_flags.size(); i < n; ++i) { |
| 37 | const QJsonObject& json_object = json_array_flags[i].toObject(); |
| 38 | |
| 39 | SettingEnumValue setting_enum_value; |
| 40 | setting_enum_value.key = ReadStringValue(json_object, "key"); |
| 41 | setting_enum_value.platform_flags = this->platform_flags; |
| 42 | setting_enum_value.status = this->status; |
| 43 | setting_enum_value.view = this->view; |
| 44 | LoadMetaHeader(setting_enum_value, json_object); |
| 45 | |
| 46 | this->enum_values.push_back(setting_enum_value); |
| 47 | |
| 48 | for (std::size_t i = 0, n = this->enum_values.size(); i < n; ++i) { |
| 49 | if (this->enum_values[i].key != setting_enum_value.key) { |
| 50 | continue; |
| 51 | } |
| 52 | |
| 53 | if (json_object.value("settings") != QJsonValue::Undefined) { |
| 54 | this->layer.AddSettingsSet(this->enum_values[i].settings, this, json_object.value("settings")); |
| 55 | } |
| 56 | } |
| 57 | } |
| 58 | return true; |
| 59 | } |
| 60 | |
| 61 | bool SettingMetaEnumeration::Equal(const SettingMeta& other) const { |
| 62 | if (!SettingMeta::Equal(other)) return false; |
nothing calls this directly
no test coverage detected