Fixed function to get a profile name by alias for all preset collections

This commit is contained in:
YuSanka 2019-11-29 11:02:30 +01:00
parent 71f5ed5b9e
commit 22aa17128a
6 changed files with 24 additions and 6 deletions

View file

@ -329,6 +329,20 @@ void PresetBundle::load_installed_printers(const AppConfig &config)
}
}
const std::string& PresetBundle::get_preset_name_by_alias( const Preset::Type& preset_type, const std::string& alias) const
{
// there are not aliases for Printers profiles
if (preset_type == Preset::TYPE_PRINTER || preset_type == Preset::TYPE_INVALID)
return alias;
const PresetCollection& presets = preset_type == Preset::TYPE_PRINT ? prints :
preset_type == Preset::TYPE_SLA_PRINT ? sla_prints :
preset_type == Preset::TYPE_FILAMENT ? filaments :
sla_materials;
return presets.get_preset_name_by_alias(alias);
}
void PresetBundle::load_installed_filaments(AppConfig &config)
{
if (! config.has_section(AppConfig::SECTION_FILAMENTS)) {