aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/im-menu-item.c11
-rw-r--r--src/indicator-messages.c15
2 files changed, 20 insertions, 6 deletions
diff --git a/src/im-menu-item.c b/src/im-menu-item.c
index b4a3e66..d246f01 100644
--- a/src/im-menu-item.c
+++ b/src/im-menu-item.c
@@ -67,6 +67,7 @@ im_menu_item_class_init (ImMenuItemClass *klass)
static void
im_menu_item_init (ImMenuItem *self)
{
+ g_debug("Building new IM Menu Item");
ImMenuItemPrivate * priv = IM_MENU_ITEM_GET_PRIVATE(self);
priv->listener = NULL;
@@ -123,6 +124,7 @@ icon_cb (IndicateListener * listener, IndicateListenerServer * server, IndicateL
static void
time_cb (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, gchar * propertydata, gpointer data)
{
+ g_debug("Got Time info");
ImMenuItem * self = IM_MENU_ITEM(data);
if (self == NULL) {
g_error("Menu Item callback called without a menu item");
@@ -145,6 +147,7 @@ time_cb (IndicateListener * listener, IndicateListenerServer * server, IndicateL
static void
sender_cb (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, gchar * propertydata, gpointer data)
{
+ g_debug("Got Sender Information");
ImMenuItem * self = IM_MENU_ITEM(data);
if (self == NULL) {
g_error("Menu Item callback called without a menu item");
@@ -170,6 +173,7 @@ sender_cb (IndicateListener * listener, IndicateListenerServer * server, Indicat
ImMenuItem *
im_menu_item_new (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator)
{
+ g_debug("Building a new IM Menu Item");
ImMenuItem * self = g_object_new(IM_MENU_ITEM_TYPE, NULL);
ImMenuItemPrivate * priv = IM_MENU_ITEM_GET_PRIVATE(self);
@@ -178,10 +182,13 @@ im_menu_item_new (IndicateListener * listener, IndicateListenerServer * server,
priv->server = server;
priv->indicator = indicator;
-
+ g_debug("Setting up property callbacks");
indicate_listener_get_property(listener, server, indicator, "sender", sender_cb, self);
+ g_debug(" ...sender");
indicate_listener_get_property(listener, server, indicator, "time", time_cb, self);
+ g_debug(" ...time");
indicate_listener_get_property(listener, server, indicator, "icon", icon_cb, self);
+ g_debug(" ...icon");
- return;
+ return self;
}
diff --git a/src/indicator-messages.c b/src/indicator-messages.c
index a026798..be27489 100644
--- a/src/indicator-messages.c
+++ b/src/indicator-messages.c
@@ -39,7 +39,11 @@ imHash_destroy (gpointer data)
static void
subtype_cb (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, gchar * propertydata, gpointer data)
{
- GtkMenu * menushell = GTK_MENU(data);
+ GtkMenuShell * menushell = GTK_MENU_SHELL(data);
+ if (menushell == NULL) {
+ g_error("Data in callback is not a menushell");
+ return;
+ }
if (property == NULL || strcmp(property, "subtype")) {
/* We should only ever get subtypes, but just in case */
@@ -61,12 +65,15 @@ subtype_cb (IndicateListener * listener, IndicateListenerServer * server, Indica
hasher->server = server;
hasher->indicator = indicator;
- GtkWidget * menuitem = GTK_WIDGET(im_menu_item_new(listener, server, indicator));
- g_object_ref(menuitem);
+ g_debug("Building IM Item");
+ ImMenuItem * menuitem = im_menu_item_new(listener, server, indicator);
+ g_object_ref(G_OBJECT(menuitem));
+ g_debug("Adding to IM Hash");
g_hash_table_insert(imHash, hasher, menuitem);
- gtk_menu_shell_prepend(GTK_MENU_SHELL(menushell), menuitem);
+ g_debug("Placing in Shell");
+ gtk_menu_shell_prepend(menushell, menuitem);
#if 0
} else if (!strcmp(propertydata, "mail")) {
gpointer pntr_menu_item;