1
0
mirror of https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git synced 2026-07-14 08:34:26 +00:00

Fix of #5319 - presets inherited from renamed presets using the old

preset name in the "inherits" field were losing the "inherits" flag.
This commit is contained in:
Vojtech Bubnik
2020-12-08 17:45:50 +01:00
parent 661ad1735b
commit 6e3fae3865
2 changed files with 7 additions and 1 deletions
+5 -1
View File
@@ -1316,6 +1316,8 @@ std::string PresetCollection::section_name() const
}
}
// Used for validating the "inherits" flag when importing user's config bundles.
// Returns names of all system presets including the former names of these presets.
std::vector<std::string> PresetCollection::system_preset_names() const
{
size_t num = 0;
@@ -1325,8 +1327,10 @@ std::vector<std::string> PresetCollection::system_preset_names() const
std::vector<std::string> out;
out.reserve(num);
for (const Preset &preset : m_presets)
if (preset.is_system)
if (preset.is_system) {
out.emplace_back(preset.name);
out.insert(out.end(), preset.renamed_from.begin(), preset.renamed_from.end());
}
std::sort(out.begin(), out.end());
return out;
}