mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-21 20:18:17 +08:00
Fix #1526 --datadir not working
This commit is contained in:
parent
360dbca52e
commit
237eaa5f6f
@ -3118,6 +3118,13 @@ CLIConfigDef::CLIConfigDef()
|
|||||||
const CLIConfigDef cli_config_def;
|
const CLIConfigDef cli_config_def;
|
||||||
DynamicPrintAndCLIConfig::PrintAndCLIConfigDef DynamicPrintAndCLIConfig::s_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)
|
std::ostream& print_cli_options(std::ostream& out)
|
||||||
{
|
{
|
||||||
for (const auto& opt : cli_config_def.options) {
|
for (const auto& opt : cli_config_def.options) {
|
||||||
|
@ -1171,6 +1171,12 @@ public:
|
|||||||
const ConfigDef* def() const override { return &s_def; }
|
const ConfigDef* def() const override { return &s_def; }
|
||||||
t_config_option_keys keys() const override { return s_def.keys(); }
|
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:
|
private:
|
||||||
class PrintAndCLIConfigDef : public ConfigDef
|
class PrintAndCLIConfigDef : public ConfigDef
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user