diff options
author | Ted Gould <ted@canonical.com> | 2009-10-01 12:34:00 -0500 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-10-01 12:34:00 -0500 |
commit | d8c1b21a0908d35c7aabf39af40244eb5957e7bc (patch) | |
tree | a4c611261ea31fb665ad2f645d87af1bda0fac34 | |
parent | 161e7c3904951f093501a59b0c653d6ff17c7ff0 (diff) | |
parent | 9efd8c2c35b87625e3fc3539fb074869a9ece8b5 (diff) | |
download | libdbusmenu-d8c1b21a0908d35c7aabf39af40244eb5957e7bc.tar.gz libdbusmenu-d8c1b21a0908d35c7aabf39af40244eb5957e7bc.tar.bz2 libdbusmenu-d8c1b21a0908d35c7aabf39af40244eb5957e7bc.zip |
Better messages
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | libdbusmenu-glib/menuitem.c | 21 |
2 files changed, 19 insertions, 8 deletions
diff --git a/debian/changelog b/debian/changelog index ef8dfb9..a7e8298 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libdbusmenu (0.1.5-0ubuntu1~ppa2~bugfix3) UNRELEASED; urgency=low + + * Better messages + + -- Ted Gould <ted@ubuntu.com> Thu, 01 Oct 2009 12:33:48 -0500 + libdbusmenu (0.1.5-0ubuntu1~ppa2~bugfix2) karmic; urgency=low * Typo++ diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index a6dba37..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(data)), dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(user_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", dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(mi)), dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(child))); + 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", dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(mi)), dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(child))); + 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", dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(mi)), dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(child))); + 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 moved %d", dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(mi)), dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(child))); + 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, value); + 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; |