ENH: [STUDIO-1871] merge changes of user presets from other sessions

Change-Id: I2841ff4e23b18ebe7cdf374b69a494a4c05a49ee
This commit is contained in:
chunmao.guo 2023-01-09 14:13:14 +08:00 committed by Lane.Wei
parent e71b5a88b7
commit ae959b7400
4 changed files with 28 additions and 15 deletions

View file

@ -1543,6 +1543,10 @@ bool PresetCollection::load_user_preset(std::string name, std::map<std::string,
BOOST_LOG_TRIVIAL(error) << "Error in a preset file: The preset \"" <<
name << "\" contains the following incorrect keys: " << incorrect_keys << ", which were removed";
if (need_update) {
if (iter->name == m_edited_preset.name && iter->is_dirty) {
// Keep modifies when update from remote
new_config.apply_only(m_edited_preset.config, m_edited_preset.config.diff(iter->config));
}
iter->config = new_config;
iter->updated_time = cloud_update_time;
iter->version = cloud_version.value();