[retro-gtk] core: Rename content-directory to core-assets-directory



commit d64ec4e468be84380e6b0b55db72e4b839f91273
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Tue Jul 27 09:30:41 2021 +0200

    core: Rename content-directory to core-assets-directory
    
    This matches the new name in Libretro instead of the deprecated one.

 retro-gtk/retro-core.c            | 45 ++++++++++++++++++---------------------
 retro-gtk/retro-core.h            |  6 +++---
 retro-runner/ipc-runner-impl.c    |  4 ++--
 retro-runner/retro-core-private.h |  2 +-
 retro-runner/retro-core.c         | 39 ++++++++++++++++-----------------
 retro-runner/retro-core.h         |  6 +++---
 retro-runner/retro-environment.c  |  2 +-
 shared/org.gnome.Retro.Runner.xml |  2 +-
 8 files changed, 50 insertions(+), 56 deletions(-)
---
diff --git a/retro-gtk/retro-core.c b/retro-gtk/retro-core.c
index c85b345..ce8e6c3 100644
--- a/retro-gtk/retro-core.c
+++ b/retro-gtk/retro-core.c
@@ -67,7 +67,7 @@ struct _RetroCore
 
   gchar *filename;
   gchar *system_directory;
-  gchar *content_directory;
+  gchar *core_assets_directory;
   gchar *save_directory;
   gchar *user_name;
 
@@ -99,7 +99,7 @@ enum {
   PROP_API_VERSION,
   PROP_FILENAME,
   PROP_SYSTEM_DIRECTORY,
-  PROP_CONTENT_DIRECTORY,
+  PROP_CORE_ASSETS_DIRECTORY,
   PROP_SAVE_DIRECTORY,
   PROP_USER_NAME,
   PROP_IS_INITIATED,
@@ -188,7 +188,7 @@ retro_core_finalize (GObject *object)
   g_object_unref (self->process);
   g_free (self->filename);
   g_free (self->system_directory);
-  g_free (self->content_directory);
+  g_free (self->core_assets_directory);
   g_free (self->save_directory);
   g_clear_object (&self->keyboard_widget);
 
@@ -216,8 +216,8 @@ retro_core_get_property (GObject    *object,
     g_value_set_string (value, retro_core_get_system_directory (self));
 
     break;
-  case PROP_CONTENT_DIRECTORY:
-    g_value_set_string (value, retro_core_get_content_directory (self));
+  case PROP_CORE_ASSETS_DIRECTORY:
+    g_value_set_string (value, retro_core_get_core_assets_directory (self));
 
     break;
   case PROP_SAVE_DIRECTORY:
@@ -276,8 +276,8 @@ retro_core_set_property (GObject      *object,
     retro_core_set_system_directory (self, g_value_get_string (value));
 
     break;
-  case PROP_CONTENT_DIRECTORY:
-    retro_core_set_content_directory (self, g_value_get_string (value));
+  case PROP_CORE_ASSETS_DIRECTORY:
+    retro_core_set_core_assets_directory (self, g_value_get_string (value));
 
     break;
   case PROP_SAVE_DIRECTORY:
@@ -364,11 +364,10 @@ retro_core_class_init (RetroCoreClass *klass)
                          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",
-                         "Content directory",
-                         "The content directory",
+  properties[PROP_CORE_ASSETS_DIRECTORY] =
+    g_param_spec_string ("core-assets-directory",
+                         "Core assets directory",
+                         "The core assets directory",
                          NULL,
                          G_PARAM_READWRITE |
                          G_PARAM_STATIC_NAME |
@@ -793,29 +792,27 @@ 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 deprecated by Libretro.
 const gchar *
-retro_core_get_content_directory (RetroCore *self)
+retro_core_get_core_assets_directory (RetroCore *self)
 {
   g_return_val_if_fail (RETRO_IS_CORE (self), NULL);
 
-  return self->content_directory;
+  return self->core_assets_directory;
 }
 
-// FIXME This should be removed as it is deprecated by Libretro.
 void
-retro_core_set_content_directory (RetroCore   *self,
-                                  const gchar *content_directory)
+retro_core_set_core_assets_directory (RetroCore   *self,
+                                      const gchar *core_assets_directory)
 {
   g_return_if_fail (RETRO_IS_CORE (self));
 
-  if (g_strcmp0 (content_directory, retro_core_get_content_directory (self)) == 0)
+  if (g_strcmp0 (core_assets_directory, retro_core_get_core_assets_directory (self)) == 0)
     return;
 
-  g_free (self->content_directory);
-  self->content_directory = g_strdup (content_directory);
+  g_free (self->core_assets_directory);
+  self->core_assets_directory = g_strdup (core_assets_directory);
 
-  g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_CONTENT_DIRECTORY]);
+  g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_CORE_ASSETS_DIRECTORY]);
 }
 
 /**
@@ -1225,8 +1222,8 @@ retro_core_boot (RetroCore  *self,
   g_object_bind_property (self,  "system-directory",
                           proxy, "system-directory",
                           G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
-  g_object_bind_property (self,  "content-directory",
-                          proxy, "content-directory",
+  g_object_bind_property (self,  "core-assets-directory",
+                          proxy, "core-assets-directory",
                           G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
   g_object_bind_property (self,  "save-directory",
                           proxy, "save-directory",
diff --git a/retro-gtk/retro-core.h b/retro-gtk/retro-core.h
index 6a7d6e4..e090e36 100644
--- a/retro-gtk/retro-core.h
+++ b/retro-gtk/retro-core.h
@@ -23,9 +23,9 @@ 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_content_directory (RetroCore *self);
-void retro_core_set_content_directory (RetroCore   *self,
-                                       const gchar *content_directory);
+const gchar *retro_core_get_core_assets_directory (RetroCore *self);
+void retro_core_set_core_assets_directory (RetroCore   *self,
+                                           const gchar *core_assets_directory);
 const gchar *retro_core_get_save_directory (RetroCore *self);
 void retro_core_set_save_directory (RetroCore   *self,
                                     const gchar *save_directory);
diff --git a/retro-runner/ipc-runner-impl.c b/retro-runner/ipc-runner-impl.c
index d11c3f9..c1b6b7a 100644
--- a/retro-runner/ipc-runner-impl.c
+++ b/retro-runner/ipc-runner-impl.c
@@ -472,8 +472,8 @@ ipc_runner_impl_constructed (GObject *object)
   g_object_bind_property (self->core, "system-directory",
                           self,       "system-directory",
                           G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
-  g_object_bind_property (self->core, "content-directory",
-                          self,       "content-directory",
+  g_object_bind_property (self->core, "core-assets-directory",
+                          self,       "core-assets-directory",
                           G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
   g_object_bind_property (self->core, "save-directory",
                           self,       "save-directory",
diff --git a/retro-runner/retro-core-private.h b/retro-runner/retro-core-private.h
index a7cd2b2..840975b 100644
--- a/retro-runner/retro-core-private.h
+++ b/retro-runner/retro-core-private.h
@@ -30,7 +30,7 @@ struct _RetroCore
   gchar *filename;
   gchar *system_directory;
   gchar *libretro_path;
-  gchar *content_directory;
+  gchar *core_assets_directory;
   gchar *save_directory;
   gchar *user_name;
   gboolean is_initiated;
diff --git a/retro-runner/retro-core.c b/retro-runner/retro-core.c
index da7e1f5..52f8012 100644
--- a/retro-runner/retro-core.c
+++ b/retro-runner/retro-core.c
@@ -32,7 +32,7 @@ enum {
   PROP_API_VERSION,
   PROP_FILENAME,
   PROP_SYSTEM_DIRECTORY,
-  PROP_CONTENT_DIRECTORY,
+  PROP_CORE_ASSETS_DIRECTORY,
   PROP_SAVE_DIRECTORY,
   PROP_USER_NAME,
   PROP_IS_INITIATED,
@@ -130,7 +130,7 @@ retro_core_finalize (GObject *object)
   g_free (self->filename);
   g_free (self->system_directory);
   g_free (self->libretro_path);
-  g_free (self->content_directory);
+  g_free (self->core_assets_directory);
   g_free (self->save_directory);
   g_clear_object (&self->renderer);
 
@@ -158,8 +158,8 @@ retro_core_get_property (GObject    *object,
     g_value_set_string (value, retro_core_get_system_directory (self));
 
     break;
-  case PROP_CONTENT_DIRECTORY:
-    g_value_set_string (value, retro_core_get_content_directory (self));
+  case PROP_CORE_ASSETS_DIRECTORY:
+    g_value_set_string (value, retro_core_get_core_assets_directory (self));
 
     break;
   case PROP_SAVE_DIRECTORY:
@@ -214,8 +214,8 @@ retro_core_set_property (GObject      *object,
     retro_core_set_system_directory (self, g_value_get_string (value));
 
     break;
-  case PROP_CONTENT_DIRECTORY:
-    retro_core_set_content_directory (self, g_value_get_string (value));
+  case PROP_CORE_ASSETS_DIRECTORY:
+    retro_core_set_core_assets_directory (self, g_value_get_string (value));
 
     break;
   case PROP_SAVE_DIRECTORY:
@@ -302,11 +302,10 @@ retro_core_class_init (RetroCoreClass *klass)
                          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",
-                         "Content directory",
-                         "The content directory",
+  properties[PROP_CORE_ASSETS_DIRECTORY] =
+    g_param_spec_string ("core-assets-directory",
+                         "Core assets directory",
+                         "The core assets directory",
                          NULL,
                          G_PARAM_READWRITE |
                          G_PARAM_STATIC_NAME |
@@ -1109,28 +1108,26 @@ retro_core_get_libretro_path (RetroCore *self)
   return self->libretro_path;
 }
 
-// FIXME This should be removed as it is deprecated by Libretro.
 const gchar *
-retro_core_get_content_directory (RetroCore *self)
+retro_core_get_core_assets_directory (RetroCore *self)
 {
   g_return_val_if_fail (RETRO_IS_CORE (self), NULL);
 
-  return self->content_directory;
+  return self->core_assets_directory;
 }
 
-// FIXME This should be removed as it is deprecated by Libretro.
 void
-retro_core_set_content_directory (RetroCore   *self,
-                                  const gchar *content_directory)
+retro_core_set_core_assets_directory (RetroCore   *self,
+                                      const gchar *core_assets_directory)
 {
   g_return_if_fail (RETRO_IS_CORE (self));
 
-  if (g_strcmp0 (content_directory, retro_core_get_content_directory (self)) == 0)
+  if (g_strcmp0 (core_assets_directory, retro_core_get_core_assets_directory (self)) == 0)
     return;
 
-  g_free (self->content_directory);
-  self->content_directory = g_strdup (content_directory);
-  g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_CONTENT_DIRECTORY]);
+  g_free (self->core_assets_directory);
+  self->core_assets_directory = g_strdup (core_assets_directory);
+  g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_CORE_ASSETS_DIRECTORY]);
 }
 
 /**
diff --git a/retro-runner/retro-core.h b/retro-runner/retro-core.h
index 47f3663..6a7df2d 100644
--- a/retro-runner/retro-core.h
+++ b/retro-runner/retro-core.h
@@ -22,9 +22,9 @@ 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_content_directory (RetroCore *self);
-void retro_core_set_content_directory (RetroCore   *self,
-                                       const gchar *content_directory);
+const gchar *retro_core_get_core_assets_directory (RetroCore *self);
+void retro_core_set_core_assets_directory (RetroCore   *self,
+                                           const gchar *core_assets_directory);
 const gchar *retro_core_get_save_directory (RetroCore *self);
 void retro_core_set_save_directory (RetroCore   *self,
                                     const gchar *save_directory);
diff --git a/retro-runner/retro-environment.c b/retro-runner/retro-environment.c
index 0e60a9d..fbf143c 100644
--- a/retro-runner/retro-environment.c
+++ b/retro-runner/retro-environment.c
@@ -248,7 +248,7 @@ get_core_assets_directory (RetroCore    *self,
   g_assert (self);
   g_return_val_if_fail (core_assets_directory, FALSE);
 
-  *(core_assets_directory) = retro_core_get_content_directory (self);
+  *(core_assets_directory) = retro_core_get_core_assets_directory (self);
   retro_sanitize_string (core_assets_directory);
 
   retro_debug ("Get core assets directory: %s", *core_assets_directory);
diff --git a/shared/org.gnome.Retro.Runner.xml b/shared/org.gnome.Retro.Runner.xml
index 9865303..5c02a88 100644
--- a/shared/org.gnome.Retro.Runner.xml
+++ b/shared/org.gnome.Retro.Runner.xml
@@ -5,7 +5,7 @@
   <interface name="org.gnome.Retro.Runner">
     <property name="ApiVersion" type="u" access="read"/>
     <property name="SystemDirectory" type="s" access="readwrite"/>
-    <property name="ContentDirectory" type="s" access="readwrite"/>
+    <property name="CoreAssetsDirectory" type="s" access="readwrite"/>
     <property name="SaveDirectory" type="s" access="readwrite"/>
     <property name="UserName" type="s" access="readwrite"/>
     <property name="GameLoaded" type="b" access="read"/>


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