summaryrefslogtreecommitdiff
path: root/libnm/nm-dhcp4-config.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnm/nm-dhcp4-config.c')
-rw-r--r--libnm/nm-dhcp4-config.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/libnm/nm-dhcp4-config.c b/libnm/nm-dhcp4-config.c
index 3cdbb4a183..88e6898216 100644
--- a/libnm/nm-dhcp4-config.c
+++ b/libnm/nm-dhcp4-config.c
@@ -23,7 +23,6 @@
#include "nm-dhcp4-config.h"
#include "nm-dbus-interface.h"
-#include "nm-types-private.h"
#include "nm-object-private.h"
#include "nm-utils.h"
@@ -32,7 +31,7 @@ G_DEFINE_TYPE (NMDhcp4Config, nm_dhcp4_config, NM_TYPE_OBJECT)
#define NM_DHCP4_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP4_CONFIG, NMDhcp4ConfigPrivate))
typedef struct {
- DBusGProxy *proxy;
+ GDBusProxy *proxy;
GHashTable *options;
} NMDhcp4ConfigPrivate;
@@ -53,21 +52,19 @@ nm_dhcp4_config_init (NMDhcp4Config *config)
}
static gboolean
-demarshal_dhcp4_options (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field)
+demarshal_dhcp4_options (NMObject *object, GParamSpec *pspec, GVariant *value, gpointer field)
{
NMDhcp4ConfigPrivate *priv = NM_DHCP4_CONFIG_GET_PRIVATE (object);
- GHashTable *new_options;
- GHashTableIter iter;
+ GVariantIter iter;
const char *key;
- GValue *opt;
+ GVariant *opt;
g_hash_table_remove_all (priv->options);
- new_options = g_value_get_boxed (value);
- if (new_options) {
- g_hash_table_iter_init (&iter, new_options);
- while (g_hash_table_iter_next (&iter, (gpointer) &key, (gpointer) &opt))
- g_hash_table_insert (priv->options, g_strdup (key), g_value_dup_string (opt));
+ g_variant_iter_init (&iter, value);
+ while (g_variant_iter_next (&iter, "{&sv}", &key, &opt)) {
+ g_hash_table_insert (priv->options, g_strdup (key), g_variant_dup_string (opt, NULL));
+ g_variant_unref (opt);
}
_nm_object_queue_notify (object, NM_DHCP4_CONFIG_OPTIONS);