From 418e2a36b4174978fe462623ed1065ddb42b7e4b Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Sun, 20 Nov 2016 16:29:44 +0100 Subject: [PATCH] libnm-glib: drop some unneeded code ...so that we don't have to fix the following: libnm-glib/nm-object-private.h:30: Warning: NMClient: symbol='NMObjectCreatorFunc': missing parameter name; undocumentable libnm-glib/nm-object-private.h:30: Warning: NMClient: symbol='NMObjectCreatorFunc': missing parameter name; undocumentable Fixes: ad5daa098c308ae58a6d54c453c73451044598fc --- libnm-glib/nm-object-private.h | 2 -- libnm-glib/nm-types-private.h | 4 --- libnm-glib/nm-types.c | 46 ---------------------------------- 3 files changed, 52 deletions(-) diff --git a/libnm-glib/nm-object-private.h b/libnm-glib/nm-object-private.h index 2d3d8f9cb0..1786f33d8c 100644 --- a/libnm-glib/nm-object-private.h +++ b/libnm-glib/nm-object-private.h @@ -27,8 +27,6 @@ void _nm_object_ensure_inited (NMObject *object); typedef gboolean (*PropertyMarshalFunc) (NMObject *, GParamSpec *, GValue *, gpointer); -typedef GObject * (*NMObjectCreatorFunc) (DBusGConnection *, const char *); - typedef struct { const char *name; gpointer field; diff --git a/libnm-glib/nm-types-private.h b/libnm-glib/nm-types-private.h index c34d9a8f7c..7cd907dc22 100644 --- a/libnm-glib/nm-types-private.h +++ b/libnm-glib/nm-types-private.h @@ -28,10 +28,6 @@ gboolean _nm_ssid_demarshal (GValue *value, GByteArray **dest); gboolean _nm_uint_array_demarshal (GValue *value, GArray **dest); gboolean _nm_string_array_demarshal (GValue *value, GPtrArray **dest); -gboolean _nm_object_array_demarshal (GValue *value, - GPtrArray **dest, - DBusGConnection *connection, - NMObjectCreatorFunc func); gboolean _nm_ip6_address_array_demarshal (GValue *value, GSList **dest); #endif /* NM_TYPES_PRIVATE_H */ diff --git a/libnm-glib/nm-types.c b/libnm-glib/nm-types.c index 5fe1eb535c..4f7236d365 100644 --- a/libnm-glib/nm-types.c +++ b/libnm-glib/nm-types.c @@ -230,52 +230,6 @@ nm_object_array_get_type (void) return our_type; } -gboolean -_nm_object_array_demarshal (GValue *value, - GPtrArray **dest, - DBusGConnection *connection, - NMObjectCreatorFunc func) -{ - GPtrArray *temp = NULL; - GPtrArray *array; - - if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH)) - return FALSE; - - array = (GPtrArray *) g_value_get_boxed (value); - if (array && array->len) { - int i; - - temp = g_ptr_array_sized_new (array->len); - for (i = 0; i < array->len; i++) { - const char *path; - GObject *object; - - path = g_ptr_array_index (array, i); - object = G_OBJECT (_nm_object_cache_get (path)); - if (object) - g_ptr_array_add (temp, object); - else { - object = (*func) (connection, path); - if (object) - g_ptr_array_add (temp, object); - else - g_warning ("%s: couldn't create object for %s", __func__, path); - } - } - } else - temp = g_ptr_array_new (); - - /* Deallocate after to ensure that an object that might already - * be in the array doesn't get destroyed due to refcounting. - */ - if (*dest) - g_boxed_free (NM_TYPE_OBJECT_ARRAY, *dest); - *dest = temp; - - return TRUE; -} - /*****************************************************************************/ static gpointer