mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-15 12:34:55 +00:00
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: ad5daa098c
This commit is contained in:
parent
bf70ed2e86
commit
418e2a36b4
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue