Commit 2ffd5e5e authored by Adrien Plazas's avatar Adrien Plazas
Browse files

retro: Set the save dir of the core

https://bugzilla.gnome.org/show_bug.cgi?id=782772
parent 246dd9f7
......@@ -42,6 +42,7 @@ public class Games.RetroRunner : Object, Runner {
private Gtk.EventBox widget;
private string save_directory_path;
private string save_path;
private string snapshot_path;
private string screenshot_path;
......@@ -277,6 +278,10 @@ public class Games.RetroRunner : Object, Runner {
var platforms_dir = Application.get_platforms_dir ();
var platform = core_source.get_platform ();
core.system_directory = @"$platforms_dir/$platform/system";
var save_directory = get_save_directory_path ();
try_make_dir (save_directory);
core.save_directory = save_directory;
}
core.log.connect (Retro.g_log);
......@@ -395,6 +400,17 @@ public class Games.RetroRunner : Object, Runner {
should_save = false;
}
private string get_save_directory_path () throws Error {
if (save_directory_path != null)
return save_directory_path;
var dir = Application.get_saves_dir ();
var uid = uid.get_uid ();
save_directory_path = @"$dir/$uid";
return save_directory_path;
}
private string get_save_path () throws Error {
if (save_path != null)
return save_path;
......
Supports Markdown
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