diff options
author | YuSanka <yusanka@gmail.com> | 2019-11-25 12:40:36 +0300 |
---|---|---|
committer | YuSanka <yusanka@gmail.com> | 2019-11-25 12:40:36 +0300 |
commit | 6429c3bd890b3617e37c4dfed5a1a66e6ee65493 (patch) | |
tree | baff457e4c5785df111e4f50cb4b3df170878895 /src/slic3r/GUI/PresetBundle.cpp | |
parent | 1096c24fae11ffa05e82d2d004b016f6b22e3b4f (diff) |
Added code for next step of a preset's aliasing
Diffstat (limited to 'src/slic3r/GUI/PresetBundle.cpp')
-rw-r--r-- | src/slic3r/GUI/PresetBundle.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/slic3r/GUI/PresetBundle.cpp b/src/slic3r/GUI/PresetBundle.cpp index af7c2a0e7..43280cd4f 100644 --- a/src/slic3r/GUI/PresetBundle.cpp +++ b/src/slic3r/GUI/PresetBundle.cpp @@ -1133,12 +1133,10 @@ size_t PresetBundle::load_configbundle(const std::string &path, unsigned int fla preset_name = section.first.substr(9); for (const auto& item : section.second) - { if (boost::starts_with(item.first, "alias")) { alias_name = item.second.data(); break; } - } } else if (boost::starts_with(section.first, "sla_print:")) { presets = &this->sla_prints; loaded = &loaded_sla_prints; @@ -1295,8 +1293,14 @@ size_t PresetBundle::load_configbundle(const std::string &path, unsigned int fla loaded.is_system = true; loaded.vendor = vendor_profile; } - if (!alias_name.empty()) - loaded.alias = alias_name; + + // next step of an preset name aliasing + int end_pos = preset_name.find_first_of("@"); + if (end_pos != std::string::npos) + alias_name = preset_name.substr(0, end_pos - 1); + + loaded.alias = alias_name.empty() ? preset_name : alias_name; + ++ presets_loaded; } } |