diff options
author | Ken VanDine <ken.vandine@canonical.com> | 2009-10-05 01:38:17 -0400 |
---|---|---|
committer | Ken VanDine <ken.vandine@canonical.com> | 2009-10-05 01:38:17 -0400 |
commit | 2161c05f527d0d8e36410628214a7d920de66044 (patch) | |
tree | 3199325d538b75b07a0083f043573bd0de92a811 /libdbusmenu-glib/client.c | |
parent | 29a1c8d0b290c9d131f9f22418d93066953b3460 (diff) | |
parent | 3f51b2b3f1550026d7b0af2dbbe007af6e89e302 (diff) | |
download | libdbusmenu-2161c05f527d0d8e36410628214a7d920de66044.tar.gz libdbusmenu-2161c05f527d0d8e36410628214a7d920de66044.tar.bz2 libdbusmenu-2161c05f527d0d8e36410628214a7d920de66044.zip |
* Upstream release 0.1.6 (LP: #442822)
* Managing the life-cycle of the GTK Menu item better to
ensure that it is positioned correctly and dies
appropriately. (LP: #430904) and (LP: #419953)
* Checking returned properties to ensure that there wasn't
DBus errors. (LP: #433719)
Diffstat (limited to 'libdbusmenu-glib/client.c')
-rw-r--r-- | libdbusmenu-glib/client.c | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index e2679e1..ab307bd 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -322,6 +322,10 @@ layout_update (DBusGProxy * proxy, gint revision, DbusmenuClient * client) static void id_prop_update (DBusGProxy * proxy, guint id, gchar * property, gchar * value, DbusmenuClient * client) { + #ifdef MASSIVEDEBUGGING + g_debug("Property change sent to client for item %d property %s value %s", id, property, g_utf8_strlen(value, 50) < 25 ? value : "<too long>"); + #endif + DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client); g_return_if_fail(priv->root != NULL); @@ -337,6 +341,10 @@ id_prop_update (DBusGProxy * proxy, guint id, gchar * property, gchar * value, D static void id_update (DBusGProxy * proxy, guint id, DbusmenuClient * client) { + #ifdef MASSIVEDEBUGGING + g_debug("Client side ID update: %d", id); + #endif + DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client); g_return_if_fail(priv->root != NULL); @@ -414,6 +422,9 @@ proxy_destroyed (GObject * gobj_proxy, gpointer userdata) if (priv->root != NULL) { g_object_unref(G_OBJECT(priv->root)); priv->root = NULL; + #ifdef MASSIVEDEBUGGING + g_debug("Proxies destroyed, signaling a root change and a layout update."); + #endif g_signal_emit(G_OBJECT(userdata), signals[ROOT_CHANGED], 0, NULL, TRUE); g_signal_emit(G_OBJECT(userdata), signals[LAYOUT_UPDATED], 0, TRUE); } @@ -565,6 +576,10 @@ get_properties_helper (gpointer key, gpointer value, gpointer data) static void menuitem_get_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * error, gpointer data) { + if (error != NULL) { + g_warning("Error getting properties on a menuitem: %s", error->message); + return; + } g_hash_table_foreach(properties, get_properties_helper, data); g_hash_table_destroy(properties); return; @@ -575,6 +590,10 @@ menuitem_get_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError static void menuitem_get_properties_new_cb (DBusGProxy * proxy, GHashTable * properties, GError * error, gpointer data) { + if (error != NULL) { + g_warning("Error getting properties on a new menuitem: %s", error->message); + return; + } g_return_if_fail(data != NULL); newItemPropData * propdata = (newItemPropData *)data; @@ -598,6 +617,9 @@ menuitem_get_properties_new_cb (DBusGProxy * proxy, GHashTable * properties, GEr handled = newfunc(propdata->item, propdata->parent, propdata->client); } + #ifdef MASSIVEDEBUGGING + g_debug("Client has realized a menuitem: %d", dbusmenu_menuitem_get_id(propdata->item)); + #endif g_signal_emit(G_OBJECT(propdata->item), DBUSMENU_MENUITEM_SIGNAL_REALIZED_ID, 0, TRUE); if (!handled) { @@ -635,7 +657,9 @@ static DbusmenuMenuitem * parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * item, DbusmenuMenuitem * parent, DBusGProxy * proxy) { guint id = parse_node_get_id(node); - /* g_debug("Looking at node with id: %d", id); */ + #ifdef MASSIVEDEBUGGING + g_debug("Client looking at node with id: %d", id); + #endif if (item == NULL || dbusmenu_menuitem_get_id(item) != id || id == 0) { if (item != NULL) { if (parent != NULL) { @@ -699,7 +723,9 @@ parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * it GList * oldchildleft = NULL; for (oldchildleft = oldchildren; oldchildleft != NULL; oldchildleft = g_list_next(oldchildleft)) { DbusmenuMenuitem * oldmi = DBUSMENU_MENUITEM(oldchildleft->data); + #ifdef MASSIVEDEBUGGING g_debug("Unref'ing menu item with layout update. ID: %d", dbusmenu_menuitem_get_id(oldmi)); + #endif g_object_unref(G_OBJECT(oldmi)); } g_list_free(oldchildren); @@ -712,6 +738,10 @@ parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * it static gint parse_layout (DbusmenuClient * client, const gchar * layout) { + #ifdef MASSIVEDEBUGGING + g_debug("Client Parsing a new layout"); + #endif + DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client); xmlDocPtr xmldoc; @@ -730,6 +760,9 @@ parse_layout (DbusmenuClient * client, const gchar * layout) } if (priv->root != oldroot) { + #ifdef MASSIVEDEBUGGING + g_debug("Client signaling root changed."); + #endif g_signal_emit(G_OBJECT(client), signals[ROOT_CHANGED], 0, priv->root, TRUE); } @@ -764,6 +797,9 @@ update_layout_cb (DBusGProxy * proxy, DBusGProxyCall * call, void * data) priv->my_revision = rev; /* g_debug("Root is now: 0x%X", (unsigned int)priv->root); */ + #ifdef MASSIVEDEBUGGING + g_debug("Client signaling layout has changed."); + #endif g_signal_emit(G_OBJECT(client), signals[LAYOUT_UPDATED], 0, TRUE); if (priv->my_revision < priv->current_revision) { @@ -852,6 +888,10 @@ dbusmenu_client_get_root (DbusmenuClient * client) return NULL; } + #ifdef MASSIVEDEBUGGING + g_debug("Client get root: %X", (guint)priv->root); + #endif + return priv->root; } @@ -884,6 +924,10 @@ dbusmenu_client_add_type_handler (DbusmenuClient * client, const gchar * type, D DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client); + #ifdef MASSIVEDEBUGGING + g_debug("Adding a type handler for '%s'", type); + #endif + if (priv->type_handlers == NULL) { g_warning("Type handlers hashtable not built"); return FALSE; |