aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdbusmenu-glib/menuitem.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c
index 4346743..bfc1a20 100644
--- a/libdbusmenu-glib/menuitem.c
+++ b/libdbusmenu-glib/menuitem.c
@@ -32,6 +32,11 @@ License version 3 and version 2.1 along with this program. If not, see
#include "menuitem.h"
#include "menuitem-marshal.h"
+#ifdef MASSIVEDEBUGGING
+#define LABEL(x) dbusmenu_menuitem_property_get(DBUSMENU_MENUITEM(x), DBUSMENU_MENUITEM_PROP_LABEL)
+#define ID(x) dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(x))
+#endif
+
/* Private */
/**
DbusmenuMenuitemPrivate:
@@ -363,7 +368,7 @@ static void
take_children_signal (gpointer data, gpointer user_data)
{
#ifdef MASSIVEDEBUGGING
- g_debug("Menuitem %d signalling child removed %d", dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(user_data)), dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(data)));
+ g_debug("Menuitem %d (%s) signalling child removed %d (%s)", ID(user_data), LABEL(user_data), ID(data), LABEL(data));
#endif
g_signal_emit(G_OBJECT(user_data), signals[CHILD_REMOVED], 0, DBUSMENU_MENUITEM(data), TRUE);
return;
@@ -442,7 +447,7 @@ dbusmenu_menuitem_child_append (DbusmenuMenuitem * mi, DbusmenuMenuitem * child)
DbusmenuMenuitemPrivate * priv = DBUSMENU_MENUITEM_GET_PRIVATE(mi);
priv->children = g_list_append(priv->children, child);
#ifdef MASSIVEDEBUGGING
- g_debug("Menuitem %d signalling child added %d at %d", dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(mi)), dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(child)), g_list_length(priv->children) - 1);
+ g_debug("Menuitem %d (%s) signalling child added %d (%s) at %d", ID(mi), LABEL(mi), ID(child), LABEL(child), g_list_length(priv->children) - 1);
#endif
g_signal_emit(G_OBJECT(mi), signals[CHILD_ADDED], 0, child, g_list_length(priv->children) - 1, TRUE);
return TRUE;
@@ -467,7 +472,7 @@ dbusmenu_menuitem_child_prepend (DbusmenuMenuitem * mi, DbusmenuMenuitem * child
DbusmenuMenuitemPrivate * priv = DBUSMENU_MENUITEM_GET_PRIVATE(mi);
priv->children = g_list_prepend(priv->children, child);
#ifdef MASSIVEDEBUGGING
- g_debug("Menuitem %d signalling child added %d at %d", dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(mi)), dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(child)), 0);
+ g_debug("Menuitem %d (%s) signalling child added %d (%s) at %d", ID(mi), LABEL(mi), ID(child), LABEL(child), 0);
#endif
g_signal_emit(G_OBJECT(mi), signals[CHILD_ADDED], 0, child, 0, TRUE);
return TRUE;
@@ -493,7 +498,7 @@ dbusmenu_menuitem_child_delete (DbusmenuMenuitem * mi, DbusmenuMenuitem * child)
DbusmenuMenuitemPrivate * priv = DBUSMENU_MENUITEM_GET_PRIVATE(mi);
priv->children = g_list_remove(priv->children, child);
#ifdef MASSIVEDEBUGGING
- g_debug("Menuitem %d signalling child removed %d", dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(mi)), dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(child)));
+ g_debug("Menuitem %d (%s) signalling child removed %d (%s)", ID(mi), LABEL(mi), ID(child), LABEL(child));
#endif
g_signal_emit(G_OBJECT(mi), signals[CHILD_REMOVED], 0, child, TRUE);
return TRUE;
@@ -520,7 +525,7 @@ dbusmenu_menuitem_child_add_position (DbusmenuMenuitem * mi, DbusmenuMenuitem *
DbusmenuMenuitemPrivate * priv = DBUSMENU_MENUITEM_GET_PRIVATE(mi);
priv->children = g_list_insert(priv->children, child, position);
#ifdef MASSIVEDEBUGGING
- g_debug("Menuitem %d signalling child added %d at %d", dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(mi)), dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(child)), position);
+ g_debug("Menuitem %d (%s) signalling child added %d (%s) at %d", ID(mi), LABEL(mi), ID(child), LABEL(child), position);
#endif
g_signal_emit(G_OBJECT(mi), signals[CHILD_ADDED], 0, child, position, TRUE);
return TRUE;
@@ -559,7 +564,7 @@ dbusmenu_menuitem_child_reorder(DbusmenuMenuitem * mi, DbusmenuMenuitem * child,
priv->children = g_list_insert(priv->children, child, position);
#ifdef MASSIVEDEBUGGING
- g_debug("Menuitem %d signalling child %d moved from %d to %d", dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(mi)), dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(child)), oldpos, position);
+ g_debug("Menuitem %d (%s) signalling child %d (%s) moved from %d to %d", ID(mi), LABEL(mi), ID(child), LABEL(child), oldpos, position);
#endif
g_signal_emit(G_OBJECT(mi), signals[CHILD_MOVED], 0, child, position, oldpos, TRUE);
@@ -677,7 +682,7 @@ dbusmenu_menuitem_property_set (DbusmenuMenuitem * mi, const gchar * property, c
g_hash_table_insert(priv->properties, lprop, lval);
#ifdef MASSIVEDEBUGGING
- g_debug("Menuitem %d signalling property '%s' changed to '%s'", dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(mi)), property, g_utf8_strlen(value, 50) < 25 ? value : "<too long>");
+ g_debug("Menuitem %d (%s) signalling property '%s' changed to '%s'", ID(mi), LABEL(mi), property, g_utf8_strlen(value, 50) < 25 ? value : "<too long>");
#endif
g_signal_emit(G_OBJECT(mi), signals[PROPERTY_CHANGED], 0, property, value, TRUE);
@@ -904,7 +909,7 @@ dbusmenu_menuitem_activate (DbusmenuMenuitem * mi)
{
g_return_if_fail(DBUSMENU_IS_MENUITEM(mi));
#ifdef MASSIVEDEBUGGING
- g_debug("Menuitem %d activated", dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(mi)));
+ g_debug("Menuitem %d (%s) activated", ID(mi), LABEL(mi));
#endif
g_signal_emit(G_OBJECT(mi), signals[ITEM_ACTIVATED], 0, TRUE);
return;