mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 12:40:16 +01:00
core: use nm_dbus_utils_g_value_set_object_path_from_hash()
This commit is contained in:
parent
de5d07392d
commit
a5e9980b34
2 changed files with 6 additions and 17 deletions
|
|
@ -15146,9 +15146,6 @@ get_property (GObject *object, guint prop_id,
|
|||
{
|
||||
NMDevice *self = NM_DEVICE (object);
|
||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
|
||||
GPtrArray *array;
|
||||
GHashTableIter iter;
|
||||
NMConnection *connection;
|
||||
GVariantBuilder array_builder;
|
||||
|
||||
switch (prop_id) {
|
||||
|
|
@ -15254,12 +15251,9 @@ get_property (GObject *object, guint prop_id,
|
|||
g_value_set_uint (value, priv->rfkill_type);
|
||||
break;
|
||||
case PROP_AVAILABLE_CONNECTIONS:
|
||||
array = g_ptr_array_sized_new (g_hash_table_size (priv->available_connections));
|
||||
g_hash_table_iter_init (&iter, priv->available_connections);
|
||||
while (g_hash_table_iter_next (&iter, (gpointer) &connection, NULL))
|
||||
g_ptr_array_add (array, g_strdup (nm_dbus_object_get_path (NM_DBUS_OBJECT (connection))));
|
||||
g_ptr_array_add (array, NULL);
|
||||
g_value_take_boxed (value, (char **) g_ptr_array_free (array, FALSE));
|
||||
nm_dbus_utils_g_value_set_object_path_from_hash (value,
|
||||
priv->available_connections,
|
||||
TRUE);
|
||||
break;
|
||||
case PROP_PHYSICAL_PORT_ID:
|
||||
g_value_set_string (value, priv->physical_port_id);
|
||||
|
|
|
|||
|
|
@ -1871,9 +1871,7 @@ get_property (GObject *object, guint prop_id,
|
|||
NMSettings *self = NM_SETTINGS (object);
|
||||
NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE (self);
|
||||
const GSList *specs, *iter;
|
||||
GHashTableIter citer;
|
||||
GPtrArray *array;
|
||||
const char *path;
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_UNMANAGED_SPECS:
|
||||
|
|
@ -1894,12 +1892,9 @@ get_property (GObject *object, guint prop_id,
|
|||
g_value_set_boolean (value, !!get_plugin (self, NM_SETTINGS_PLUGIN_CAP_MODIFY_CONNECTIONS));
|
||||
break;
|
||||
case PROP_CONNECTIONS:
|
||||
array = g_ptr_array_sized_new (g_hash_table_size (priv->connections) + 1);
|
||||
g_hash_table_iter_init (&citer, priv->connections);
|
||||
while (g_hash_table_iter_next (&citer, (gpointer) &path, NULL))
|
||||
g_ptr_array_add (array, g_strdup (path));
|
||||
g_ptr_array_add (array, NULL);
|
||||
g_value_take_boxed (value, (char **) g_ptr_array_free (array, FALSE));
|
||||
nm_dbus_utils_g_value_set_object_path_from_hash (value,
|
||||
priv->connections,
|
||||
TRUE);
|
||||
break;
|
||||
case PROP_STARTUP_COMPLETE:
|
||||
g_value_set_boolean (value, nm_settings_get_startup_complete (self));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue