diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 215b17481..7da839dc3 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -3118,6 +3118,13 @@ CLIConfigDef::CLIConfigDef() const CLIConfigDef cli_config_def; DynamicPrintAndCLIConfig::PrintAndCLIConfigDef DynamicPrintAndCLIConfig::s_def; +void DynamicPrintAndCLIConfig::handle_legacy(t_config_option_key &opt_key, std::string &value) const +{ + if (cli_config_def.options.find(opt_key) == cli_config_def.options.end()) { + PrintConfigDef::handle_legacy(opt_key, value); + } +} + std::ostream& print_cli_options(std::ostream& out) { for (const auto& opt : cli_config_def.options) { diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 08f42f39b..8713ed03f 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1171,6 +1171,12 @@ public: const ConfigDef* def() const override { return &s_def; } t_config_option_keys keys() const override { return s_def.keys(); } + // Verify whether the opt_key has not been obsoleted or renamed. + // Both opt_key and value may be modified by handle_legacy(). + // If the opt_key is no more valid in this version of Slic3r, opt_key is cleared by handle_legacy(). + // handle_legacy() is called internally by set_deserialize(). + void handle_legacy(t_config_option_key &opt_key, std::string &value) const override; + private: class PrintAndCLIConfigDef : public ConfigDef {