fix(preset): abgeleitete User-Presets bekommen eigene P-filament_id (Issue #52)

save_current_preset() generierte eine P-ID nur bei leerem filament_id.
Von Hersteller-Presets abgeleitete Presets erben aber dessen Vendor-ID
(z.B. GFA001), wodurch sync_ams_list() auf das Vendor-Preset zurueckfiel.
Bedingung an Preset::save() angeglichen: auch non-P IDs werden ersetzt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
thysson2701
2026-06-09 13:04:26 +02:00
parent 2ddc7d703a
commit 201c24a5fb

View File

@@ -2852,7 +2852,9 @@ void PresetCollection::save_current_preset(const std::string &new_name, bool det
else if (m_type == Preset::TYPE_FILAMENT) {
preset.config.option<ConfigOptionStrings>("filament_settings_id", true)->values[0] = new_name;
// Generate a unique filament_id for user presets that don't have one yet (PR #13315).
if (preset.filament_id.empty()) {
// Also regenerate when a derived preset still carries an inherited vendor id
// (non-P), otherwise AMS sync falls back to the vendor preset (Issue #52).
if (preset.filament_id.empty() || preset.filament_id.front() != 'P') {
boost::uuids::detail::md5 hash;
boost::uuids::detail::md5::digest_type digest;
hash.process_bytes(new_name.data(), new_name.size());