Commit d7b08b71 authored by Alexander Mikhaylenko's avatar Alexander Mikhaylenko

savestate: Add save_extra_metadata()

Now that we have functions for supplying extra metadata into savestates,
we need to actually write it. For this, introduce a virtual function that
is called from set_metadata(), allowing subclasses to override it and save
the extra data.
parent 2a600f7f
......@@ -165,6 +165,9 @@ public class Games.Savestate : Object {
set_metadata (false, name, creation_date, platform, core, aspect_ratio);
}
protected virtual void save_extra_metadata (KeyFile keyfile) {
}
private void set_metadata (bool is_automatic, string? name, DateTime creation_date,
string platform, string core, double aspect_ratio) throws Error {
var metadata_file_path = Path.build_filename (path, "metadata");
......@@ -183,6 +186,9 @@ public class Games.Savestate : Object {
metadata.set_string ("Metadata", "Platform", platform);
metadata.set_string ("Metadata", "Core", core);
metadata.set_double ("Screenshot", "Aspect Ratio", aspect_ratio);
save_extra_metadata (metadata);
metadata.save_to_file (metadata_file_path);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment