GitLab repository storage has been migrated to hashed layout. Please contact Infrastructure team if you notice any issues with repositories or hooks.

Commit 7028d9b8 authored by Andrei Lisita's avatar Andrei Lisita 🎮

runner: Add delete_savestate()

parent 29c83993
......@@ -106,6 +106,9 @@ public class Games.CommandRunner : Object, Runner {
return false;
}
public void delete_savestate (Savestate savestate) {
}
public InputMode[] get_available_input_modes () {
return { };
}
......
......@@ -24,6 +24,7 @@ public interface Games.Runner : Object {
public abstract void preview_savestate (Savestate savestate);
public abstract bool try_create_savestate (bool is_automatic);
public abstract void delete_savestate (Savestate savestate);
public abstract void load_previewed_savestate () throws Error;
public abstract Savestate[] get_savestates ();
......
......@@ -72,6 +72,9 @@ private class Games.DummyRunner : Object, Runner {
return false;
}
public void delete_savestate (Savestate savestate) {
}
public InputMode[] get_available_input_modes () {
return { };
}
......
......@@ -490,6 +490,18 @@ public class Games.RetroRunner : Object, Runner {
// FIXME: The game_savestates array should be updated somehow here
}
public void delete_savestate (Savestate savestate) {
Savestate[] new_game_savestates = {};
foreach (var existing_savestate in game_savestates) {
if (savestate != existing_savestate)
new_game_savestates += existing_savestate;
}
game_savestates = new_game_savestates;
savestate.delete_from_disk ();
}
private string get_options_path () throws Error {
assert (core != null);
......
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