FIX: Fix user preset update time

Jira: none
Change-Id: I52206946ae4c2e606cd942c9d531c1e106ec1c11
This commit is contained in:
chunmao.guo 2023-10-26 20:15:36 +08:00 committed by Lane.Wei
parent 84efe8e89c
commit ea237758fa
2 changed files with 6 additions and 1 deletions

View File

@ -2131,7 +2131,6 @@ bool PresetCollection::clone_presets(std::vector<Preset const *> const &presets,
preset.config.option<ConfigOptionStrings>("filament_settings_id", true)->values[0].clear();
else if (m_type == Preset::TYPE_PRINTER)
preset.config.option<ConfigOptionString>("printer_settings_id", true)->value.clear();
preset.updated_time = (long long) Slic3r::Utils::get_current_time_utc();
}
if (!failures.empty() && !force_rewritten)
return false;

View File

@ -4487,6 +4487,9 @@ void GUI_App::sync_preset(Preset* preset)
if (!new_setting_id.empty()) {
setting_id = new_setting_id;
result = 0;
auto update_time_str = values_map[BBL_JSON_KEY_UPDATE_TIME];
if (!update_time_str.empty())
update_time = std::atoll(update_time_str.c_str());
}
else {
BOOST_LOG_TRIVIAL(trace) << "[sync_preset]init: request_setting_id failed, http code "<<http_code;
@ -4513,6 +4516,9 @@ void GUI_App::sync_preset(Preset* preset)
if (!new_setting_id.empty()) {
setting_id = new_setting_id;
result = 0;
auto update_time_str = values_map[BBL_JSON_KEY_UPDATE_TIME];
if (!update_time_str.empty())
update_time = std::atoll(update_time_str.c_str());
}
else {
BOOST_LOG_TRIVIAL(trace) << "[sync_preset]create: request_setting_id failed, http code "<<http_code;