[gnome-games/wip/exalm/runner-refactor: 46/56] retro-runner: Do actual loading in load_savestate_metadata()



commit 262d16ae75254299ab4821acce74c9c5c0246f56
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sat Mar 7 03:15:57 2020 +0500

    retro-runner: Do actual loading in load_savestate_metadata()

 src/retro/retro-runner.vala | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
---
diff --git a/src/retro/retro-runner.vala b/src/retro/retro-runner.vala
index 7c50ebf7..ea68a880 100644
--- a/src/retro/retro-runner.vala
+++ b/src/retro/retro-runner.vala
@@ -254,16 +254,6 @@ public class Games.RetroRunner : Object, Runner {
        }
 
        public void load_previewed_savestate () throws Error {
-               tmp_save_dir = create_tmp_save_dir ();
-               previewed_savestate.copy_save_dir_to (tmp_save_dir);
-               core.save_directory = tmp_save_dir;
-
-               load_save_ram (previewed_savestate.get_save_ram_path ());
-               core.load_state (previewed_savestate.get_snapshot_path ());
-
-               if (previewed_savestate.has_media_data ())
-                       media_set.selected_media_number = previewed_savestate.get_media_data ();
-
                load_savestate_metadata (previewed_savestate);
        }
 
@@ -517,6 +507,15 @@ public class Games.RetroRunner : Object, Runner {
        }
 
        protected virtual void load_savestate_metadata (Savestate savestate) throws Error {
+               tmp_save_dir = create_tmp_save_dir ();
+               savestate.copy_save_dir_to (tmp_save_dir);
+               core.save_directory = tmp_save_dir;
+
+               load_save_ram (savestate.get_save_ram_path ());
+               core.load_state (savestate.get_snapshot_path ());
+
+               if (savestate.has_media_data ())
+                       media_set.selected_media_number = savestate.get_media_data ();
        }
 
        protected virtual void reset_metadata (Savestate? last_savestate) throws Error {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]