Fix/fixed unicode preset name issue (#13458)

* fixed an issue for unicode preset name
This commit is contained in:
SoftFever
2026-05-03 15:42:45 +08:00
committed by GitHub
parent 6fd4984cad
commit 66b3d5e263
2 changed files with 7 additions and 7 deletions

View File

@@ -1175,8 +1175,8 @@ void PlaterPresetComboBox::update()
} }
bool single_bar = false; bool single_bar = false;
wxString name = preset.name; wxString name = from_u8(preset.name);
preset_aliases[name] = get_preset_name(preset).ToStdString(); // ORCA preset_aliases[name] = get_preset_name(preset).utf8_string(); // ORCA
// Track bundle names for bundled presets // Track bundle names for bundled presets
if (preset.is_from_bundle()) { if (preset.is_from_bundle()) {
@@ -1232,7 +1232,7 @@ void PlaterPresetComboBox::update()
name = from_u8(is_selected && preset.is_dirty ? Preset::suffix_modified() + printer_model : printer_model); name = from_u8(is_selected && preset.is_dirty ? Preset::suffix_modified() + printer_model : printer_model);
if (system_printer_models.count(printer_model) == 0) { if (system_printer_models.count(printer_model) == 0) {
preset_aliases[name] = name.ToStdString(); // ORCA preset_aliases[name] = name.utf8_string(); // ORCA
system_presets.emplace(name, bmp); system_presets.emplace(name, bmp);
system_printer_models.insert(printer_model); system_printer_models.insert(printer_model);
} }
@@ -1676,8 +1676,8 @@ void TabPresetComboBox::update()
wxBitmap* bmp = get_bmp(preset); wxBitmap* bmp = get_bmp(preset);
assert(bmp); assert(bmp);
const wxString name = preset.name; const wxString name = from_u8(preset.name);
preset_aliases[name] = get_preset_name(preset).ToStdString(); preset_aliases[name] = get_preset_name(preset).utf8_string();
if (preset.is_system) if (preset.is_system)
preset_descriptions.emplace(name, from_u8(preset.description)); preset_descriptions.emplace(name, from_u8(preset.description));

View File

@@ -6808,10 +6808,10 @@ wxSizer* Tab::compatible_widget_create(wxWindow* parent, PresetDependencies &dep
// Collect and set indices of depending_presets marked as compatible. // Collect and set indices of depending_presets marked as compatible.
wxArrayInt selections; wxArrayInt selections;
auto *compatible_printers = dynamic_cast<const ConfigOptionStrings*>(m_config->option(deps.key_list)); auto *compatible_printers = dynamic_cast<const ConfigOptionStrings*>(m_config->option(deps.key_list));
if (compatible_printers != nullptr || !compatible_printers->values.empty()) if (compatible_printers != nullptr && !compatible_printers->values.empty())
for (auto preset_name : compatible_printers->values) for (auto preset_name : compatible_printers->values)
for (size_t idx = 0; idx < presets.GetCount(); ++idx) for (size_t idx = 0; idx < presets.GetCount(); ++idx)
if (presets[idx] == preset_name) { if (presets[idx] == from_u8(preset_name)) {
selections.Add(idx); selections.Add(idx);
break; break;
} }