aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdbusmenu-glib/menuitem-proxy.c6
-rw-r--r--libdbusmenu-glib/server.c15
2 files changed, 6 insertions, 15 deletions
diff --git a/libdbusmenu-glib/menuitem-proxy.c b/libdbusmenu-glib/menuitem-proxy.c
index 7acb541..68bdcc6 100644
--- a/libdbusmenu-glib/menuitem-proxy.c
+++ b/libdbusmenu-glib/menuitem-proxy.c
@@ -173,10 +173,10 @@ handle_event (DbusmenuMenuitem * mi, const gchar * name, const GValue * value, g
/* Watches a property change and makes sure to put that value
into our property list. */
static void
-proxy_item_property_changed (DbusmenuMenuitem * mi, gchar * property, GValue * value, gpointer user_data)
+proxy_item_property_changed (DbusmenuMenuitem * mi, gchar * property, GVariant * variant, gpointer user_data)
{
DbusmenuMenuitemProxy * pmi = DBUSMENU_MENUITEM_PROXY(user_data);
- dbusmenu_menuitem_property_set_value(DBUSMENU_MENUITEM(pmi), property, value);
+ dbusmenu_menuitem_property_set_variant(DBUSMENU_MENUITEM(pmi), property, variant);
return;
}
@@ -273,7 +273,7 @@ add_menuitem (DbusmenuMenuitemProxy * pmi, DbusmenuMenuitem * mi)
GList * prop;
for (prop = props; prop != NULL; prop = g_list_next(prop)) {
gchar * prop_name = (gchar *)prop->data;
- dbusmenu_menuitem_property_set_value(DBUSMENU_MENUITEM(pmi), prop_name, dbusmenu_menuitem_property_get_value(priv->mi, prop_name));
+ dbusmenu_menuitem_property_set_variant(DBUSMENU_MENUITEM(pmi), prop_name, dbusmenu_menuitem_property_get_variant(priv->mi, prop_name));
}
g_list_free(props);
diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c
index 63d237f..4fdd6f8 100644
--- a/libdbusmenu-glib/server.c
+++ b/libdbusmenu-glib/server.c
@@ -815,8 +815,8 @@ bus_get_property (DbusmenuServer * server, GVariant * params, GDBusMethodInvocat
return;
}
- const GValue * prop = dbusmenu_menuitem_property_get_value(mi, property);
- if (prop == NULL) {
+ GVariant * variant = dbusmenu_menuitem_property_get_variant(mi, property);
+ if (variant == NULL) {
g_dbus_method_invocation_return_error(invocation,
error_quark(),
INVALID_PROPERTY_NAME,
@@ -826,16 +826,7 @@ bus_get_property (DbusmenuServer * server, GVariant * params, GDBusMethodInvocat
return;
}
- GValue vval = {0};
- g_value_init(&vval, G_TYPE_VARIANT);
-
- if (!g_value_transform(prop, &vval)) {
- g_warning("Unable to convert property '%s' value from type '%s' to variant", property, G_VALUE_TYPE_NAME(prop));
- }
-
- g_dbus_method_invocation_return_value(invocation, g_value_get_variant(&vval));
- g_value_unset(&vval);
-
+ g_dbus_method_invocation_return_value(invocation, variant);
return;
}