@@ -319,20 +319,7 @@ bool MainWindow::autosave_current_tracker_config()
319319
320320 Config trackerConfig;
321321 trackerConfig.settings = trackerSettings;
322- // Save current config
323- auto configErr = trackerConfig.writeSettings (trackerPreferences.autosaveFilePath );
324- if (configErr != ConfigError::NONE )
325- {
326- show_error_dialog (" Could not save tracker config to file\n Error: " + ConfigErrorGetName (configErr));
327- return false ;
328- }
329-
330- // Read it back and add extra tracker data
331- YAML ::Node root;
332- if (!LoadYAML (root, trackerPreferences.autosaveFilePath )) {
333- show_error_dialog (" Could not load tracker autosave" );
334- return false ;
335- }
322+ YAML ::Node root = trackerConfig.settingsToYaml ();
336323
337324 // Save which locations have been marked
338325 for (auto loc : trackerWorld.getLocations ())
@@ -390,20 +377,7 @@ bool MainWindow::autosave_current_tracker_preferences()
390377{
391378 Config trackerConfig;
392379 trackerConfig.settings = trackerSettings;
393- // Save current config
394- auto configErr = trackerConfig.writePreferences (Utility::get_app_save_path () / " tracker_preferences.yaml" );
395- if (configErr != ConfigError::NONE )
396- {
397- show_error_dialog (" Could not save tracker preferences to file\n Error: " + ConfigErrorGetName (configErr));
398- return false ;
399- }
400-
401- // Save preferences back to tracker_preferences
402- YAML ::Node pref;
403- if (!LoadYAML (pref, Utility::get_app_save_path () / " tracker_preferences.yaml" )) {
404- show_error_dialog (" Could not load tracker preferences" );
405- return false ;
406- }
380+ YAML ::Node pref = trackerConfig.preferencesToYaml ();
407381
408382 pref[" show_location_logic" ] = trackerPreferences.showLocationLogic ;
409383 pref[" show_nonprogress_locations" ] = trackerPreferences.showNonProgressLocations ;
0 commit comments