[gnome-games/wip/exalm/savestates: 11/20] savestate: Save platform in save_metadata()



commit b0af45c5d427ab0e6aeffc4cc93fa27051099360
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sun Jan 26 00:28:44 2020 +0500

    savestate: Save platform in save_metadata()

 src/core/savestate.vala     | 14 ++++++++------
 src/retro/retro-runner.vala |  6 ++----
 2 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/src/core/savestate.vala b/src/core/savestate.vala
index 32b6ad32..c8777c30 100644
--- a/src/core/savestate.vala
+++ b/src/core/savestate.vala
@@ -156,20 +156,20 @@ public class Games.Savestate : Object {
        }
 
        // Set the metadata for an automatic savestate
-       public void set_metadata_automatic (DateTime creation_date, string platform, string core, double 
aspect_ratio) throws Error {
+       public void set_metadata_automatic (DateTime creation_date, string core, double aspect_ratio) throws 
Error {
                is_automatic = true;
                this.creation_date = creation_date;
 
-               set_metadata (platform, core, aspect_ratio);
+               set_metadata (core, aspect_ratio);
        }
 
        // Set the metadata for a manual savestate
-       public void set_metadata_manual (string name, DateTime creation_date, string platform, string core, 
double aspect_ratio) throws Error {
+       public void set_metadata_manual (string name, DateTime creation_date, string core, double 
aspect_ratio) throws Error {
                is_automatic = false;
                this.name = name;
                this.creation_date = creation_date;
 
-               set_metadata (platform, core, aspect_ratio);
+               set_metadata (core, aspect_ratio);
        }
 
        protected virtual void load_metadata (KeyFile keyfile) throws KeyFileError {
@@ -189,9 +189,12 @@ public class Games.Savestate : Object {
                if (name != null)
                        keyfile.set_string ("Metadata", "Name", name);
                keyfile.set_string ("Metadata", "Creation Date", creation_date.to_string ());
+
+               // FIXME: This is unused
+               keyfile.set_string ("Metadata", "Platform", platform.get_uid_prefix ());
        }
 
-       private void set_metadata (string platform, string core, double aspect_ratio) throws Error {
+       private void set_metadata (string core, double aspect_ratio) throws Error {
                var metadata_file_path = Path.build_filename (path, "metadata");
                var metadata_file = File.new_for_path (metadata_file_path);
                var metadata = new KeyFile ();
@@ -199,7 +202,6 @@ public class Games.Savestate : Object {
                if (metadata_file.query_exists ())
                        metadata_file.@delete ();
 
-               metadata.set_string ("Metadata", "Platform", platform);
                metadata.set_string ("Metadata", "Core", core);
                metadata.set_double ("Screenshot", "Aspect Ratio", aspect_ratio);
 
diff --git a/src/retro/retro-runner.vala b/src/retro/retro-runner.vala
index a9b77815..2e27da0b 100644
--- a/src/retro/retro-runner.vala
+++ b/src/retro/retro-runner.vala
@@ -480,7 +480,6 @@ public class Games.RetroRunner : Object, Runner {
 
                // Populate the metadata file
                var now_time = new DateTime.now ();
-               var platform_prefix = platform.get_uid_prefix ();
                var ratio = Retro.pixbuf_get_aspect_ratio (current_state_pixbuf);
 
                // FIXME: Because of how saving metadata is done currently, saving
@@ -488,14 +487,13 @@ public class Games.RetroRunner : Object, Runner {
                save_savestate_metadata (tmp_live_savestate);
 
                if (is_automatic)
-                       tmp_live_savestate.set_metadata_automatic (now_time, platform_prefix,
+                       tmp_live_savestate.set_metadata_automatic (now_time,
                                                                   get_core_id (), ratio);
                else {
                        var savestate_name = create_new_savestate_name ();
 
                        tmp_live_savestate.set_metadata_manual (savestate_name, now_time,
-                                                               platform_prefix, get_core_id (),
-                                                               ratio);
+                                                               get_core_id (), ratio);
                }
 
                // Save the tmp_live_savestate into the game savestates directory


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