[gnome-games/wip/exalm/savestates: 17/22] savestate: Inline get_metadata()
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/savestates: 17/22] savestate: Inline get_metadata()
- Date: Sat, 25 Jan 2020 20:09:44 +0000 (UTC)
commit 3a817c664245c914661c78671c99ed670036cb95
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Sun Jan 26 00:44:29 2020 +0500
savestate: Inline get_metadata()
src/core/savestate.vala | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
---
diff --git a/src/core/savestate.vala b/src/core/savestate.vala
index 2d5fa161..60df07b0 100644
--- a/src/core/savestate.vala
+++ b/src/core/savestate.vala
@@ -27,28 +27,16 @@ public class Games.Savestate : Object {
if (!metadata_file.query_exists ())
return;
- var keyfile = get_metadata ();
+ var keyfile = new KeyFile ();
try {
- load_metadata (keyfile);
- }
- catch (KeyFileError e) {
- critical ("Failed to load metadata for snapshot at %s: %s", path, e.message);
- }
- }
-
- protected KeyFile get_metadata () {
- var metadata = new KeyFile ();
- var metadata_file_path = Path.build_filename (path, "metadata");
+ keyfile.load_from_file (metadata_file_path, KeyFileFlags.NONE);
- try {
- metadata.load_from_file (metadata_file_path, KeyFileFlags.NONE);
+ load_metadata (keyfile);
}
catch (Error e) {
- critical ("Failed to load metadata for %s: %s", path, e.message);
+ critical ("Failed to load metadata for snapshot at %s: %s", path, e.message);
}
-
- return metadata;
}
public void set_snapshot_data (Bytes snapshot_data) throws Error {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]