Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuSanka <yusanka@gmail.com>2019-11-29 13:02:30 +0300
committerYuSanka <yusanka@gmail.com>2019-11-29 13:02:58 +0300
commit22aa17128a1e566b646b8318147b7fa0d3f49248 (patch)
tree23f64a53f05f36abc520507ab6a1373774099cbc /src/slic3r/GUI/PresetBundle.cpp
parent71f5ed5b9e63252b0f60ce83c0e1f0c629d9ff16 (diff)
Fixed function to get a profile name by alias for all preset collections
Diffstat (limited to 'src/slic3r/GUI/PresetBundle.cpp')
-rw-r--r--src/slic3r/GUI/PresetBundle.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/slic3r/GUI/PresetBundle.cpp b/src/slic3r/GUI/PresetBundle.cpp
index 6b255a0c4..4a19a784e 100644
--- a/src/slic3r/GUI/PresetBundle.cpp
+++ b/src/slic3r/GUI/PresetBundle.cpp
@@ -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)) {