From a71759700308b803b215c80a959c69fc5606bd20 Mon Sep 17 00:00:00 2001 From: Kiss Lorand <50251547+kisslorand@users.noreply.github.com> Date: Thu, 19 Feb 2026 19:48:42 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20filament=20override=20changes=20not=20app?= =?UTF-8?q?earing=20in=20Unsaved=20Changes=20and=20showing=20as=20?= =?UTF-8?q?=E2=80=9CUndef=20category=E2=80=9D=20in=20preset=20comparison?= =?UTF-8?q?=20(#12298)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/slic3r/GUI/UnsavedChangesDialog.cpp | 36 +++++++++++++++---------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp index 54a0574fbc..c4d160ebc9 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.cpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp @@ -1661,7 +1661,8 @@ void UnsavedChangesDialog::update_tree(Preset::Type type, PresetCollection* pres //m_tree->model->AddPreset(type, from_u8(presets->get_edited_preset().name), old_pt); // Collect dirty options. - const bool deep_compare = (type == Preset::TYPE_PRINTER || type == Preset::TYPE_SLA_MATERIAL); + const bool deep_compare = (type == Preset::TYPE_PRINTER || + type == Preset::TYPE_FILAMENT || type == Preset::TYPE_SLA_MATERIAL); auto dirty_options = presets->current_dirty_options(deep_compare); // process changes of extruders count @@ -1682,11 +1683,15 @@ void UnsavedChangesDialog::update_tree(Preset::Type type, PresetCollection* pres } for (const std::string& opt_key : dirty_options) { - const Search::Option& option = searcher.get_option(opt_key, type); - if (option.opt_key() != opt_key) { - // When founded option isn't the correct one. - // It can be for dirty_options: "default_print_profile", "printer_model", "printer_settings_id", - // because of they don't exist in searcher + const std::string lookup_key = get_pure_opt_key(opt_key); + Search::Option option = searcher.get_option(lookup_key, type); + if (get_pure_opt_key(option.opt_key()) != lookup_key) + option = searcher.get_option(opt_key, get_full_label(opt_key, new_config), type); + if (get_pure_opt_key(option.opt_key()) != lookup_key) { + // When the found option is not the requested one. + // This can happen for dirty_options such as: + // "default_print_profile", "printer_model", "printer_settings_id", + // because they do not exist in the searcher. continue; } @@ -2190,7 +2195,8 @@ void DiffPresetDialog::update_tree() } // Collect dirty options. - const bool deep_compare = (type == Preset::TYPE_PRINTER || type == Preset::TYPE_SLA_MATERIAL); + const bool deep_compare = (type == Preset::TYPE_PRINTER || + type == Preset::TYPE_FILAMENT || type == Preset::TYPE_SLA_MATERIAL); auto dirty_options = type == Preset::TYPE_PRINTER && left_pt == ptFFF && left_config.opt("extruder_colour")->values.size() < right_congig.opt("extruder_colour")->values.size() ? presets->dirty_options(right_preset, left_preset, deep_compare) : @@ -2229,13 +2235,15 @@ void DiffPresetDialog::update_tree() wxString left_val = get_string_value(opt_key, left_config); wxString right_val = get_string_value(opt_key, right_congig); - Search::Option option = searcher.get_option(opt_key, get_full_label(opt_key, left_config), type); - if (option.opt_key() != opt_key) { - // temporary solution, just for testing - m_tree->Append(opt_key, type, "Undef category", "Undef group", opt_key, left_val, right_val, "undefined"); // ORCA: use low resolution compatible icon - // When founded option isn't the correct one. - // It can be for dirty_options: "default_print_profile", "printer_model", "printer_settings_id", - // because of they don't exist in searcher + const std::string lookup_key = get_pure_opt_key(opt_key); + Search::Option option = searcher.get_option(lookup_key, type); + if (get_pure_opt_key(option.opt_key()) != lookup_key) + option = searcher.get_option(opt_key, get_full_label(opt_key, left_config), type); + if (get_pure_opt_key(option.opt_key()) != lookup_key) { + // When the found option is not the requested one. + // This can happen for dirty_options such as: + // "default_print_profile", "printer_model", "printer_settings_id", + // because they do not exist in the searcher. continue; } m_tree->Append(opt_key, type, option.category_local, option.group_local, option.label_local,