From 9af07685fdb8c1e6109b4e739fe086261c009717 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Wed, 1 Jul 2026 15:25:54 +0800 Subject: [PATCH] revert changes in Preset.cpp --- src/libslic3r/Preset.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 0f014fe4c4..bc728f62e5 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -800,14 +800,10 @@ bool is_compatible_with_parent_printer(const PresetWithVendorProfile& preset, co { auto *compatible_printers = dynamic_cast(preset.preset.config.option("compatible_printers")); bool has_compatible_printers = compatible_printers != nullptr && ! compatible_printers->values.empty(); - auto contains_printer_name = [compatible_printers](const std::string &printer_name) { - return std::find(compatible_printers->values.begin(), compatible_printers->values.end(), printer_name) != - compatible_printers->values.end(); - }; //BBS: FIXME only check the parent now, but should check grand-parent as well. return has_compatible_printers && - (contains_printer_name(active_printer.preset.inherits()) || - std::any_of(active_printer.preset.renamed_from.begin(), active_printer.preset.renamed_from.end(), contains_printer_name)); + std::find(compatible_printers->values.begin(), compatible_printers->values.end(), active_printer.preset.inherits()) != + compatible_printers->values.end(); } bool is_compatible_with_printer(const PresetWithVendorProfile &preset, const PresetWithVendorProfile &active_printer, const DynamicPrintConfig *extra_config) @@ -838,13 +834,9 @@ bool is_compatible_with_printer(const PresetWithVendorProfile &preset, const Pre return true; } } - auto contains_printer_name = [compatible_printers](const std::string &printer_name) { - return std::find(compatible_printers->values.begin(), compatible_printers->values.end(), printer_name) != - compatible_printers->values.end(); - }; return preset.preset.is_default || active_printer.preset.name.empty() || !has_compatible_printers || - contains_printer_name(active_printer.preset.name) || - std::any_of(active_printer.preset.renamed_from.begin(), active_printer.preset.renamed_from.end(), contains_printer_name) || + std::find(compatible_printers->values.begin(), compatible_printers->values.end(), active_printer.preset.name) != + compatible_printers->values.end() || (!active_printer.preset.is_system && is_compatible_with_parent_printer(preset, active_printer)); }