[retro-gtk/to-c: 15/15] core: Load medias in Core.init()



commit 123f17e5e51cc2d37adf4a27f12ed5b93dcc97ed
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Fri Jul 7 09:08:58 2017 +0200

    core: Load medias in Core.init()
    
    Also make the ancient loading mechanisms private to avoid any conflict.

 demos/retro-demo.c  |    1 -
 retro-gtk/core.vala |   13 ++++++++++---
 2 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/demos/retro-demo.c b/demos/retro-demo.c
index ef60be7..d55e67e 100644
--- a/demos/retro-demo.c
+++ b/demos/retro-demo.c
@@ -46,7 +46,6 @@ retro_demo_open (GApplication  *application,
 
   g_signal_emit_by_name (self->core, "init");
 
-  retro_core_prepare (self->core);
   g_application_activate (application);
 }
 
diff --git a/retro-gtk/core.vala b/retro-gtk/core.vala
index 5c8b5c5..3e1c972 100644
--- a/retro-gtk/core.vala
+++ b/retro-gtk/core.vala
@@ -155,7 +155,7 @@ public class Core : Object {
         *
         * The Core can set it to let the frontend insert and eject disks images.
         */
-       public DiskControl disk_control_interface { internal set; get; }
+       internal DiskControl disk_control_interface { set; get; }
 
        private weak Input _input_interface;
        private ulong input_controller_connected_id;
@@ -264,6 +264,13 @@ public class Core : Object {
                init_input ();
 
                is_initiated = true;
+
+               try {
+                       load_medias ();
+               }
+               catch (Error e) {
+                       debug (e.message);
+               }
        }
 
        public extern void set_medias ([CCode (array_null_terminated = true, array_length = false)] string[] 
uris);
@@ -308,7 +315,7 @@ public class Core : Object {
         * @param game information to load the game
         * @return false if the loading failed, true otherwise
         */
-       public extern bool load_game (GameInfo game);
+       private extern bool load_game (GameInfo game);
 
        /**
         * Prepare the standalone core.
@@ -317,7 +324,7 @@ public class Core : Object {
         *
         * @return false if the preparation failed, true otherwise
         */
-       public extern bool prepare ();
+       private extern bool prepare ();
 
        /**
         * Gets the size of a region of memory.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]