[retro-gtk/wip/aplazas/controller] core: Make 'libretro-path' private and not a prop



commit e2a5fd66162827251d306cf41ec20f955fe9546e
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Wed Oct 11 19:53:34 2017 +0200

    core: Make 'libretro-path' private and not a prop
    
    There is no need for it to be public, as it is similar to filename and
    is intended to be used by the Libretro core itself.

 retro-gtk/retro-core-private.h |    1 +
 retro-gtk/retro-core.c         |   47 +--------------------------------------
 retro-gtk/retro-core.h         |    3 --
 3 files changed, 3 insertions(+), 48 deletions(-)
---
diff --git a/retro-gtk/retro-core-private.h b/retro-gtk/retro-core-private.h
index 3c4d49f..74de967 100644
--- a/retro-gtk/retro-core-private.h
+++ b/retro-gtk/retro-core-private.h
@@ -55,6 +55,7 @@ struct _RetroCore
 void retro_core_push_cb_data (RetroCore *self);
 void retro_core_pop_cb_data (void);
 RetroCore *retro_core_get_cb_data (void);
+const gchar *retro_core_get_libretro_path (RetroCore *self);
 void retro_core_set_support_no_game (RetroCore *self,
                                      gboolean   support_no_game);
 gchar *retro_core_get_name (RetroCore *self);
diff --git a/retro-gtk/retro-core.c b/retro-gtk/retro-core.c
index a209738..82ed568 100644
--- a/retro-gtk/retro-core.c
+++ b/retro-gtk/retro-core.c
@@ -22,7 +22,6 @@ enum {
   PROP_API_VERSION,
   PROP_FILENAME,
   PROP_SYSTEM_DIRECTORY,
-  PROP_LIBRETRO_PATH,
   PROP_CONTENT_DIRECTORY,
   PROP_SAVE_DIRECTORY,
   PROP_IS_INITIATED,
@@ -184,10 +183,6 @@ retro_core_get_property (GObject    *object,
     g_value_set_string (value, retro_core_get_system_directory (self));
 
     break;
-  case PROP_LIBRETRO_PATH:
-    g_value_set_string (value, retro_core_get_libretro_path (self));
-
-    break;
   case PROP_CONTENT_DIRECTORY:
     g_value_set_string (value, retro_core_get_content_directory (self));
 
@@ -236,10 +231,6 @@ retro_core_set_property (GObject      *object,
     retro_core_set_system_directory (self, g_value_get_string (value));
 
     break;
-  case PROP_LIBRETRO_PATH:
-    retro_core_set_libretro_path (self, g_value_get_string (value));
-
-    break;
   case PROP_CONTENT_DIRECTORY:
     retro_core_set_content_directory (self, g_value_get_string (value));
 
@@ -326,18 +317,6 @@ retro_core_class_init (RetroCoreClass *klass)
                          G_PARAM_STATIC_NICK |
                          G_PARAM_STATIC_BLURB);
 
-  // FIXME This should be removed as it is useful only to the core and it is
-  // computable from the filename.
-  properties[PROP_LIBRETRO_PATH] =
-    g_param_spec_string ("libretro-path",
-                         "Libretro path",
-                         "The Libretro path",
-                         NULL,
-                         G_PARAM_READWRITE |
-                         G_PARAM_STATIC_NAME |
-                         G_PARAM_STATIC_NICK |
-                         G_PARAM_STATIC_BLURB);
-
   // FIXME This should be removed as it is deprecated by Libretro.
   properties[PROP_CONTENT_DIRECTORY] =
     g_param_spec_string ("content-directory",
@@ -1147,8 +1126,6 @@ retro_core_set_system_directory (RetroCore   *self,
   g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_SYSTEM_DIRECTORY]);
 }
 
-// FIXME This should be removed as it is useful only to the core and it is
-// computable from the filename.
 const gchar *
 retro_core_get_libretro_path (RetroCore *self)
 {
@@ -1157,22 +1134,6 @@ retro_core_get_libretro_path (RetroCore *self)
   return self->libretro_path;
 }
 
-// FIXME This should be removed as it is useful only to the core and it is
-// computable from the filename.
-void
-retro_core_set_libretro_path (RetroCore   *self,
-                              const gchar *libretro_path)
-{
-  g_return_if_fail (RETRO_IS_CORE (self));
-
-  if (g_strcmp0 (libretro_path, retro_core_get_libretro_path (self)) == 0)
-    return;
-
-  g_free (self->libretro_path);
-  self->libretro_path = g_strdup (libretro_path);
-  g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_LIBRETRO_PATH]);
-}
-
 // FIXME This should be removed as it is deprecated by Libretro.
 const gchar *
 retro_core_get_content_directory (RetroCore *self)
@@ -1953,7 +1914,6 @@ retro_core_new (const gchar *filename)
   RetroCore *self;
   GFile *file;
   GFile *relative_path_file;
-  gchar *libretro_path;
 
   g_return_val_if_fail (filename != NULL, NULL);
 
@@ -1966,14 +1926,11 @@ retro_core_new (const gchar *filename)
 
   g_object_unref (file);
 
-  libretro_path = g_file_get_path (relative_path_file);
+  self->libretro_path = g_file_get_path (relative_path_file);
 
   g_object_unref (relative_path_file);
 
-  retro_core_set_libretro_path (self, libretro_path);
-  self->module = retro_module_new (libretro_path);
-
-  g_free (libretro_path);
+  self->module = retro_module_new (self->libretro_path);
 
   retro_core_set_callbacks (self);
   self->controllers = g_hash_table_new_full (g_int_hash, g_int_equal,
diff --git a/retro-gtk/retro-core.h b/retro-gtk/retro-core.h
index d784b17..5cf9f9d 100644
--- a/retro-gtk/retro-core.h
+++ b/retro-gtk/retro-core.h
@@ -24,9 +24,6 @@ const gchar *retro_core_get_filename (RetroCore *self);
 const gchar *retro_core_get_system_directory (RetroCore *self);
 void retro_core_set_system_directory (RetroCore   *self,
                                       const gchar *system_directory);
-const gchar *retro_core_get_libretro_path (RetroCore *self);
-void retro_core_set_libretro_path (RetroCore   *self,
-                                   const gchar *libretro_path);
 const gchar *retro_core_get_content_directory (RetroCore *self);
 void retro_core_set_content_directory (RetroCore   *self,
                                        const gchar *content_directory);


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