From 6df050a764d4319b84d86ee42ec3e3bf850e1e5f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 12 May 2009 15:44:51 -0500 Subject: Adding in comments for the signals in the server. --- libdbusmenu-glib/server.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'libdbusmenu-glib/server.c') diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 3db6db0..2f025d7 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -93,6 +93,16 @@ dbusmenu_server_class_init (DbusmenuServerClass *class) object_class->set_property = set_property; object_class->get_property = get_property; + /** + DbusmenuServer::id-prop-update: + @arg0: The #DbusmenuServer emitting the signal. + @arg1: The ID of the #DbusmenuMenuitem changing a property. + @arg2: The property being changed. + @arg3: The value of the property being changed. + + This signal is emitted when a menuitem updates or + adds a property. + */ signals[ID_PROP_UPDATE] = g_signal_new(DBUSMENU_SERVER_SIGNAL_ID_PROP_UPDATE, G_TYPE_FROM_CLASS(class), G_SIGNAL_RUN_LAST, @@ -100,6 +110,15 @@ dbusmenu_server_class_init (DbusmenuServerClass *class) NULL, NULL, _dbusmenu_server_marshal_VOID__UINT_STRING_STRING, G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING); + /** + DbusmenuServer::id-update: + @arg0: The #DbusmenuServer emitting the signal. + @arg1: ID of the #DbusmenuMenuitem changing. + + The purpose of this signal is to show major change in + a menuitem to the point that #DbusmenuServer::id-prop-update + seems a little insubstantive. + */ signals[ID_UPDATE] = g_signal_new(DBUSMENU_SERVER_SIGNAL_ID_UPDATE, G_TYPE_FROM_CLASS(class), G_SIGNAL_RUN_LAST, @@ -107,6 +126,13 @@ dbusmenu_server_class_init (DbusmenuServerClass *class) NULL, NULL, g_cclosure_marshal_VOID__UINT, G_TYPE_NONE, 1, G_TYPE_UINT); + /** + DbusmenuServer::layout-update: + @arg0: The #DbusmenuServer emitting the signal. + + This signal is emitted any time the layout of the + menuitems under this server is changed. + */ signals[LAYOUT_UPDATE] = g_signal_new(DBUSMENU_SERVER_SIGNAL_LAYOUT_UPDATE, G_TYPE_FROM_CLASS(class), G_SIGNAL_RUN_LAST, -- cgit v1.2.3 From f7400044fe2ab33832b73ec26b5655435f91909b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 12 May 2009 17:11:58 -0500 Subject: Setting up some function to tie into all these new fangled signals that the menu items themselves are sending. --- libdbusmenu-glib/server.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'libdbusmenu-glib/server.c') diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 2f025d7..34bc697 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -78,6 +78,11 @@ static void dbusmenu_server_dispose (GObject *object); static void dbusmenu_server_finalize (GObject *object); static void set_property (GObject * obj, guint id, const GValue * value, GParamSpec * pspec); static void get_property (GObject * obj, guint id, GValue * value, GParamSpec * pspec); +static void menuitem_property_changed (DbusmenuMenuitem * mi, gchar * property, gchar * value, DbusmenuServer * server); +static void menuitem_child_added (DbusmenuMenuitem * parent, DbusmenuMenuitem * child, DbusmenuServer * server); +static void menuitem_child_removed (DbusmenuMenuitem * parent, DbusmenuMenuitem * child, DbusmenuServer * server); +static void menuitem_signals_create (DbusmenuMenuitem * mi, gpointer data); +static void menuitem_signals_remove (DbusmenuMenuitem * mi, gpointer data); G_DEFINE_TYPE (DbusmenuServer, dbusmenu_server, G_TYPE_OBJECT); @@ -276,6 +281,49 @@ get_property (GObject * obj, guint id, GValue * value, GParamSpec * pspec) return; } +static void +menuitem_property_changed (DbusmenuMenuitem * mi, gchar * property, gchar * value, DbusmenuServer * server) +{ + + return; +} + +static void +menuitem_child_added (DbusmenuMenuitem * parent, DbusmenuMenuitem * child, DbusmenuServer * server) +{ + menuitem_signals_create(child, server); + return; +} + +static void +menuitem_child_removed (DbusmenuMenuitem * parent, DbusmenuMenuitem * child, DbusmenuServer * server) +{ + menuitem_signals_remove(child, server); + return; +} + +/* Connects all the signals that we're interested in + coming from a menuitem */ +static void +menuitem_signals_create (DbusmenuMenuitem * mi, gpointer data) +{ + g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_CHILD_ADDED, G_CALLBACK(menuitem_child_added), data); + g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_CHILD_REMOVED, G_CALLBACK(menuitem_child_removed), data); + g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(menuitem_property_changed), data); + return; +} + +/* Removes all the signals that we're interested in + coming from a menuitem */ +static void +menuitem_signals_remove (DbusmenuMenuitem * mi, gpointer data) +{ + g_signal_handlers_disconnect_by_func(G_OBJECT(mi), G_CALLBACK(menuitem_child_added), data); + g_signal_handlers_disconnect_by_func(G_OBJECT(mi), G_CALLBACK(menuitem_child_removed), data); + g_signal_handlers_disconnect_by_func(G_OBJECT(mi), G_CALLBACK(menuitem_property_changed), data); + return; +} + /* DBus interface */ static gboolean _dbusmenu_server_get_property (void) -- cgit v1.2.3 From 2a8ccfdd673c5e883754768f2d77515e35b24454 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 12 May 2009 17:16:01 -0500 Subject: Okay, now we have a lifecycle for all of our nifty signal handlers. Kinda crazy that we're building all of these suckers. Recursive setting all hidden in a nifty little function. --- libdbusmenu-glib/server.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libdbusmenu-glib/server.c') diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 34bc697..95fa1d9 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -182,6 +182,13 @@ dbusmenu_server_init (DbusmenuServer *self) static void dbusmenu_server_dispose (GObject *object) { + DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(object); + + if (priv->root != NULL) { + dbusmenu_menuitem_foreach(priv->root, menuitem_signals_remove, object); + g_object_unref(priv->root); + } + G_OBJECT_CLASS (dbusmenu_server_parent_class)->dispose (object); return; } @@ -209,12 +216,14 @@ set_property (GObject * obj, guint id, const GValue * value, GParamSpec * pspec) break; case PROP_ROOT_NODE: if (priv->root != NULL) { + dbusmenu_menuitem_foreach(priv->root, menuitem_signals_remove, obj); g_object_unref(G_OBJECT(priv->root)); priv->root = NULL; } priv->root = DBUSMENU_MENUITEM(g_value_get_object(value)); if (priv->root != NULL) { g_object_ref(G_OBJECT(priv->root)); + dbusmenu_menuitem_foreach(priv->root, menuitem_signals_create, obj); } else { g_debug("Setting root node to NULL"); } -- cgit v1.2.3 From b23056f055b443925544089bd4b822b152fcf039 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 12 May 2009 17:18:42 -0500 Subject: Signaling that the layout has changed when there are children added or removed --- libdbusmenu-glib/server.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libdbusmenu-glib/server.c') diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 95fa1d9..62d0505 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -301,6 +301,8 @@ static void menuitem_child_added (DbusmenuMenuitem * parent, DbusmenuMenuitem * child, DbusmenuServer * server) { menuitem_signals_create(child, server); + /* TODO: We probably need to group the layout update signals to make the number more reasonble. */ + g_signal_emit(G_OBJECT(server), signals[LAYOUT_UPDATE], 0, TRUE); return; } @@ -308,6 +310,8 @@ static void menuitem_child_removed (DbusmenuMenuitem * parent, DbusmenuMenuitem * child, DbusmenuServer * server) { menuitem_signals_remove(child, server); + /* TODO: We probably need to group the layout update signals to make the number more reasonble. */ + g_signal_emit(G_OBJECT(server), signals[LAYOUT_UPDATE], 0, TRUE); return; } -- cgit v1.2.3 From 81f7009789863c2666c11474ec6ea0d6d875972d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 12 May 2009 17:25:31 -0500 Subject: Passing on the signal from the menuitem up the stack and out the DBus. --- libdbusmenu-glib/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libdbusmenu-glib/server.c') diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 62d0505..847a186 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -293,7 +293,7 @@ get_property (GObject * obj, guint id, GValue * value, GParamSpec * pspec) static void menuitem_property_changed (DbusmenuMenuitem * mi, gchar * property, gchar * value, DbusmenuServer * server) { - + g_signal_emit(G_OBJECT(server), signals[ID_PROP_UPDATE], 0, dbusmenu_menuitem_get_id(mi), property, value, TRUE); return; } -- cgit v1.2.3 From e45d87762470fc1b0ce363d95de49e94be17444f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 15 May 2009 14:58:15 -0500 Subject: Fleshing out server_call and getting ready for more. --- libdbusmenu-glib/server.c | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) (limited to 'libdbusmenu-glib/server.c') diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 847a186..37659af 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -34,10 +34,10 @@ License version 3 and version 2.1 along with this program. If not, see #include "server-marshal.h" /* DBus Prototypes */ -static gboolean _dbusmenu_server_get_property (void); +static gboolean _dbusmenu_server_get_property (DbusmenuServer * server, guint id, gchar * property, gchar ** value, GError ** error); static gboolean _dbusmenu_server_get_properties (void); -static gboolean _dbusmenu_server_call (void); static gboolean _dbusmenu_server_list_properties (void); +static gboolean _dbusmenu_server_call (DbusmenuServer * server, guint id, GError ** error); #include "dbusmenu-server.h" @@ -71,6 +71,12 @@ enum { PROP_LAYOUT }; +/* Errors */ +enum { + INVALID_MENUITEM_ID, + LAST_ERROR +}; + /* Prototype */ static void dbusmenu_server_class_init (DbusmenuServerClass *class); static void dbusmenu_server_init (DbusmenuServer *self); @@ -83,6 +89,7 @@ static void menuitem_child_added (DbusmenuMenuitem * parent, DbusmenuMenuitem * static void menuitem_child_removed (DbusmenuMenuitem * parent, DbusmenuMenuitem * child, DbusmenuServer * server); static void menuitem_signals_create (DbusmenuMenuitem * mi, gpointer data); static void menuitem_signals_remove (DbusmenuMenuitem * mi, gpointer data); +static GQuark error_quark (void); G_DEFINE_TYPE (DbusmenuServer, dbusmenu_server, G_TYPE_OBJECT); @@ -337,9 +344,19 @@ menuitem_signals_remove (DbusmenuMenuitem * mi, gpointer data) return; } +static GQuark +error_quark (void) +{ + static GQuark quark = 0; + if (quark == 0) { + quark = g_quark_from_static_string (G_LOG_DOMAIN); + } + return quark; +} + /* DBus interface */ static gboolean -_dbusmenu_server_get_property (void) +_dbusmenu_server_get_property (DbusmenuServer * server, guint id, gchar * property, gchar ** value, GError ** error) { return TRUE; @@ -353,16 +370,30 @@ _dbusmenu_server_get_properties (void) } static gboolean -_dbusmenu_server_call (void) +_dbusmenu_server_list_properties (void) { return TRUE; } static gboolean -_dbusmenu_server_list_properties (void) +_dbusmenu_server_call (DbusmenuServer * server, guint id, GError ** error) { + DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server); + DbusmenuMenuitem * mi = dbusmenu_menuitem_find_id(priv->root, id); + + if (mi == NULL) { + if (error != NULL) { + g_set_error(error, + error_quark(), + INVALID_MENUITEM_ID, + "The ID supplied %d does not refer to a menu item we have", + id); + } + return FALSE; + } + dbusmenu_menuitem_activate(mi); return TRUE; } -- cgit v1.2.3 From e95af4b8e1facef6fe42346ecc73ef14cb92b640 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 15 May 2009 15:03:35 -0500 Subject: Reworking the DBus interface slightly. Making it so that the properties are now sent in a dict and that there isn't an arbitrary listing of things. It's either grab all or grab one. Seems to apply to the use cases better. --- libdbusmenu-glib/server.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'libdbusmenu-glib/server.c') diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 37659af..3e2fd78 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -36,7 +36,6 @@ License version 3 and version 2.1 along with this program. If not, see /* DBus Prototypes */ static gboolean _dbusmenu_server_get_property (DbusmenuServer * server, guint id, gchar * property, gchar ** value, GError ** error); static gboolean _dbusmenu_server_get_properties (void); -static gboolean _dbusmenu_server_list_properties (void); static gboolean _dbusmenu_server_call (DbusmenuServer * server, guint id, GError ** error); #include "dbusmenu-server.h" @@ -369,13 +368,6 @@ _dbusmenu_server_get_properties (void) return TRUE; } -static gboolean -_dbusmenu_server_list_properties (void) -{ - - return TRUE; -} - static gboolean _dbusmenu_server_call (DbusmenuServer * server, guint id, GError ** error) { -- cgit v1.2.3 From 56fad3ec6db3ef3cb589446a11a45d06da339dd9 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 15 May 2009 15:07:01 -0500 Subject: Starting to flesh out more of this DBus stuff --- libdbusmenu-glib/server.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'libdbusmenu-glib/server.c') diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 3e2fd78..6336ffd 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -35,7 +35,7 @@ License version 3 and version 2.1 along with this program. If not, see /* DBus Prototypes */ static gboolean _dbusmenu_server_get_property (DbusmenuServer * server, guint id, gchar * property, gchar ** value, GError ** error); -static gboolean _dbusmenu_server_get_properties (void); +static gboolean _dbusmenu_server_get_properties (DbusmenuServer * server, guint id, gpointer dict, GError ** error); static gboolean _dbusmenu_server_call (DbusmenuServer * server, guint id, GError ** error); #include "dbusmenu-server.h" @@ -357,13 +357,39 @@ error_quark (void) static gboolean _dbusmenu_server_get_property (DbusmenuServer * server, guint id, gchar * property, gchar ** value, GError ** error) { + DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server); + DbusmenuMenuitem * mi = dbusmenu_menuitem_find_id(priv->root, id); + + if (mi == NULL) { + if (error != NULL) { + g_set_error(error, + error_quark(), + INVALID_MENUITEM_ID, + "The ID supplied %d does not refer to a menu item we have", + id); + } + return FALSE; + } return TRUE; } static gboolean -_dbusmenu_server_get_properties (void) +_dbusmenu_server_get_properties (DbusmenuServer * server, guint id, gpointer dict, GError ** error) { + DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server); + DbusmenuMenuitem * mi = dbusmenu_menuitem_find_id(priv->root, id); + + if (mi == NULL) { + if (error != NULL) { + g_set_error(error, + error_quark(), + INVALID_MENUITEM_ID, + "The ID supplied %d does not refer to a menu item we have", + id); + } + return FALSE; + } return TRUE; } -- cgit v1.2.3 From 9f60fb948c1be4f681332445cf44fb6dc151fe90 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 15 May 2009 15:13:12 -0500 Subject: More error handling in the properties interface. --- libdbusmenu-glib/server.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'libdbusmenu-glib/server.c') diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 6336ffd..02aed24 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -73,6 +73,8 @@ enum { /* Errors */ enum { INVALID_MENUITEM_ID, + INVALID_PROPERTY_NAME, + UNKNOWN_DBUS_ERROR, LAST_ERROR }; @@ -371,6 +373,31 @@ _dbusmenu_server_get_property (DbusmenuServer * server, guint id, gchar * proper return FALSE; } + const gchar * prop = dbusmenu_menuitem_property_get(mi, property); + if (prop == NULL) { + if (error != NULL) { + g_set_error(error, + error_quark(), + INVALID_PROPERTY_NAME, + "The property '%s' does not exist on menuitem with ID of %d", + property, + id); + } + return FALSE; + } + + if (value == NULL) { + if (error != NULL) { + g_set_error(error, + error_quark(), + UNKNOWN_DBUS_ERROR, + "Uhm, yeah. We didn't get anywhere to put the value, that's really weird. Seems impossible really."); + } + return FALSE; + } + + *value = g_strdup(prop); + return TRUE; } -- cgit v1.2.3 From 749d436792f990048a66273e350211d2b8fd5de9 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 19 May 2009 00:01:03 +0200 Subject: Ah, finally found the right prototype for dicts, whoo hoo, just love dynamic typing in C. --- libdbusmenu-glib/server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libdbusmenu-glib/server.c') diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 02aed24..61f8e86 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -35,7 +35,7 @@ License version 3 and version 2.1 along with this program. If not, see /* DBus Prototypes */ static gboolean _dbusmenu_server_get_property (DbusmenuServer * server, guint id, gchar * property, gchar ** value, GError ** error); -static gboolean _dbusmenu_server_get_properties (DbusmenuServer * server, guint id, gpointer dict, GError ** error); +static gboolean _dbusmenu_server_get_properties (DbusmenuServer * server, guint id, GHashTable ** dict, GError ** error); static gboolean _dbusmenu_server_call (DbusmenuServer * server, guint id, GError ** error); #include "dbusmenu-server.h" @@ -402,7 +402,7 @@ _dbusmenu_server_get_property (DbusmenuServer * server, guint id, gchar * proper } static gboolean -_dbusmenu_server_get_properties (DbusmenuServer * server, guint id, gpointer dict, GError ** error) +_dbusmenu_server_get_properties (DbusmenuServer * server, guint id, GHashTable ** dict, GError ** error) { DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server); DbusmenuMenuitem * mi = dbusmenu_menuitem_find_id(priv->root, id); -- cgit v1.2.3 From febdeee323173b3019fc78f5ed0453a99249eb19 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 19 May 2009 00:19:48 +0200 Subject: Use the new proprties_copy function to make DBus work :) --- libdbusmenu-glib/server.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libdbusmenu-glib/server.c') diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 61f8e86..c865824 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -418,6 +418,8 @@ _dbusmenu_server_get_properties (DbusmenuServer * server, guint id, GHashTable * return FALSE; } + *dict = dbusmenu_menuitem_properties_copy(mi); + return TRUE; } -- cgit v1.2.3 From 9ce161afed2050ca706912f0308e9f9e842c04c0 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 19 May 2009 04:08:59 +0200 Subject: Disabling a large number of debug messages. Most aren't needed anymore. --- libdbusmenu-glib/server.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libdbusmenu-glib/server.c') diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index c865824..562b2d7 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -274,7 +274,7 @@ get_property (GObject * obj, guint id, GValue * value, GParamSpec * pspec) case PROP_LAYOUT: { GPtrArray * xmlarray = g_ptr_array_new(); if (priv->root == NULL) { - g_debug("Getting layout without root node!"); + /* g_debug("Getting layout without root node!"); */ g_ptr_array_add(xmlarray, g_strdup("")); } else { dbusmenu_menuitem_buildxml(priv->root, xmlarray); @@ -284,7 +284,7 @@ get_property (GObject * obj, guint id, GValue * value, GParamSpec * pspec) /* build string */ gchar * finalstring = g_strjoinv("", (gchar **)xmlarray->pdata); g_value_take_string(value, finalstring); - g_debug("Final string: %s", finalstring); + /* g_debug("Final string: %s", finalstring); */ g_ptr_array_foreach(xmlarray, xmlarray_foreach_free, NULL); g_ptr_array_free(xmlarray, TRUE); @@ -485,7 +485,7 @@ dbusmenu_server_set_root (DbusmenuServer * self, DbusmenuMenuitem * root) g_return_if_fail(DBUSMENU_IS_SERVER(self)); g_return_if_fail(DBUSMENU_IS_MENUITEM(root)); - g_debug("Setting root object: 0x%X", (unsigned int)root); + /* g_debug("Setting root object: 0x%X", (unsigned int)root); */ GValue rootvalue = {0}; g_value_init(&rootvalue, G_TYPE_OBJECT); g_value_set_object(&rootvalue, root); -- cgit v1.2.3 From 4614822dddd73d5ab16f7f97555f99e8b5460d4c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 25 May 2009 23:08:14 +0200 Subject: Unref'ing the object put into the GValue as it gets reffed there. --- libdbusmenu-glib/server.c | 1 + 1 file changed, 1 insertion(+) (limited to 'libdbusmenu-glib/server.c') diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 562b2d7..cf8ea85 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -490,6 +490,7 @@ dbusmenu_server_set_root (DbusmenuServer * self, DbusmenuMenuitem * root) g_value_init(&rootvalue, G_TYPE_OBJECT); g_value_set_object(&rootvalue, root); g_object_set_property(G_OBJECT(self), DBUSMENU_SERVER_PROP_ROOT_NODE, &rootvalue); + g_object_unref(G_OBJECT(root)); return; } -- cgit v1.2.3