[gnome-games/wip/exalm/savestates: 12/20] savestate: Save core in save_metadata()
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/savestates: 12/20] savestate: Save core in save_metadata()
- Date: Sat, 25 Jan 2020 20:02:14 +0000 (UTC)
commit 8a7480e495301ec1ce5d81c4f05f6b4ab572bbd4
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Sun Jan 26 00:34:08 2020 +0500
savestate: Save core in save_metadata()
src/core/savestate.vala | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/core/savestate.vala b/src/core/savestate.vala
index c8777c30..e0abbdad 100644
--- a/src/core/savestate.vala
+++ b/src/core/savestate.vala
@@ -7,6 +7,7 @@ public class Games.Savestate : Object {
public bool is_automatic { get; private set; }
public string name { get; set; }
public DateTime? creation_date { get; private set; }
+ public string core { get; private set; }
private static Savestate load (Platform platform, string path) {
var type = platform.get_savestate_type ();
@@ -159,8 +160,9 @@ public class Games.Savestate : Object {
public void set_metadata_automatic (DateTime creation_date, string core, double aspect_ratio) throws
Error {
is_automatic = true;
this.creation_date = creation_date;
+ this.core = core;
- set_metadata (core, aspect_ratio);
+ set_metadata (aspect_ratio);
}
// Set the metadata for a manual savestate
@@ -168,8 +170,9 @@ public class Games.Savestate : Object {
is_automatic = false;
this.name = name;
this.creation_date = creation_date;
+ this.core = core;
- set_metadata (core, aspect_ratio);
+ set_metadata (aspect_ratio);
}
protected virtual void load_metadata (KeyFile keyfile) throws KeyFileError {
@@ -192,9 +195,10 @@ public class Games.Savestate : Object {
// FIXME: This is unused
keyfile.set_string ("Metadata", "Platform", platform.get_uid_prefix ());
+ keyfile.set_string ("Metadata", "Core", core);
}
- private void set_metadata (string core, double aspect_ratio) throws Error {
+ private void set_metadata (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 ();
@@ -202,7 +206,6 @@ public class Games.Savestate : Object {
if (metadata_file.query_exists ())
metadata_file.@delete ();
- metadata.set_string ("Metadata", "Core", core);
metadata.set_double ("Screenshot", "Aspect Ratio", aspect_ratio);
save_metadata (metadata);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]