From 936925dcd9c76af59928344a6be6dd0c0aebfcaf Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Mon, 9 Nov 2020 16:27:51 +0000
Subject: [PATCH] json-utils: Rename _srt_json_object_dup_strv_member

It seems misleading to have a function with json_array in the name that
takes a JsonObject.

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 steam-runtime-tools/json-utils-internal.h | 4 ++--
 steam-runtime-tools/json-utils.c          | 6 +++---
 steam-runtime-tools/system-info.c         | 6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/steam-runtime-tools/json-utils-internal.h b/steam-runtime-tools/json-utils-internal.h
index af01e3ef8..b3e1d208d 100644
--- a/steam-runtime-tools/json-utils-internal.h
+++ b/steam-runtime-tools/json-utils-internal.h
@@ -40,5 +40,5 @@ guint srt_get_flags_from_json_array (GType flags_type,
                                      const gchar *array_member,
                                      guint flag_if_unknown);
 
-gchar ** _srt_json_array_to_strv (JsonObject *json_obj,
-                                  const gchar *array_member);
+gchar ** _srt_json_object_dup_strv_member (JsonObject *json_obj,
+                                           const gchar *array_member);
diff --git a/steam-runtime-tools/json-utils.c b/steam-runtime-tools/json-utils.c
index a752f1267..422d2456e 100644
--- a/steam-runtime-tools/json-utils.c
+++ b/steam-runtime-tools/json-utils.c
@@ -80,7 +80,7 @@ out:
 }
 
 /**
- * _srt_json_array_to_strv:
+ * _srt_json_object_dup_strv_member:
  * @json_obj: (not nullable): A JSON Object used to search for
  *  @array_member property
  * @array_member: (not nullable): The JSON member to look up
@@ -93,8 +93,8 @@ out:
  *  property @array_member
  */
 gchar **
-_srt_json_array_to_strv (JsonObject *json_obj,
-                         const gchar *array_member)
+_srt_json_object_dup_strv_member (JsonObject *json_obj,
+                                  const gchar *array_member)
 {
   JsonArray *array;
   guint length;
diff --git a/steam-runtime-tools/system-info.c b/steam-runtime-tools/system-info.c
index 899a542c4..83121dfd3 100644
--- a/steam-runtime-tools/system-info.c
+++ b/steam-runtime-tools/system-info.c
@@ -1349,9 +1349,9 @@ _srt_system_info_get_pinned_libs_from_report (JsonObject *json_obj,
     {
       json_pinned_obj = json_object_get_object_member (json_obj, which);
 
-      pinned_list = _srt_json_array_to_strv (json_pinned_obj, "list");
+      pinned_list = _srt_json_object_dup_strv_member (json_pinned_obj, "list");
 
-      *messages = _srt_json_array_to_strv (json_pinned_obj, "messages");
+      *messages = _srt_json_object_dup_strv_member (json_pinned_obj, "messages");
     }
 
   return pinned_list;
@@ -3232,7 +3232,7 @@ srt_system_info_list_driver_environment (SrtSystemInfo *self)
 static gchar **
 _srt_system_info_driver_environment_from_report (JsonObject *json_obj)
 {
-  return _srt_json_array_to_strv (json_obj, "driver_environment");
+  return _srt_json_object_dup_strv_member (json_obj, "driver_environment");
 }
 
 typedef struct
-- 
GitLab