From 7823baf6ae4d84d7796bd003f2c3f0bb0122d126 Mon Sep 17 00:00:00 2001 From: karl-qdh Date: Sun, 6 Mar 2011 17:08:13 +0000 Subject: Tried using uint but still segfaulting in variant code --- src/datetime-service.c | 2 +- src/indicator-datetime.c | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/datetime-service.c b/src/datetime-service.c index ffaafb0..b097217 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -284,7 +284,7 @@ month_changed_cb (DbusmenuMenuitem * menuitem, GVariant *variant, guint timestam // * Check what our current month/year are // * Set some globals so when we-re-run update appointment menu items it gets the right start date // * update appointment menu items - g_debug("Received month changed : %s", g_variant_get_string(variant, NULL)); + g_debug("Received month changed : %d", g_variant_get_uint32(variant)); return TRUE; } diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c index 0d10579..944b33d 100644 --- a/src/indicator-datetime.c +++ b/src/indicator-datetime.c @@ -1197,7 +1197,14 @@ month_changed_cb (IdoCalendarMenuItem *ido, DbusmenuMenuitem * item = DBUSMENU_MENUITEM (user_data); ido_calendar_menu_item_get_date(ido, &y, &m, &d); g_sprintf(datestring, "%d-%d-%d", y, m, d); - GVariant *variant = g_variant_new_string(datestring); + struct tm date; + date.tm_mday = d; + date.tm_mon = m; + date.tm_year = y; + date.tm_hour = 0; + date.tm_min = 0; + guint selecteddate = (guint)mktime(&date); + GVariant *variant = g_variant_new_uint32(selecteddate); guint timestamp = (guint)time(NULL); dbusmenu_menuitem_handle_event(DBUSMENU_MENUITEM(item), "month-changed", variant, timestamp); g_debug("Got month changed signal: %s", datestring); -- cgit v1.2.3