diff options
author | karl-qdh <karl@qdh.org.uk> | 2011-03-06 17:08:13 +0000 |
---|---|---|
committer | karl-qdh <karl@qdh.org.uk> | 2011-03-06 17:08:13 +0000 |
commit | 7823baf6ae4d84d7796bd003f2c3f0bb0122d126 (patch) | |
tree | ecf5cda1a466a6abafded366799a698e728fea22 | |
parent | 9485b01a79c5a7ebe563986295acf24f6ce7df1a (diff) | |
download | ayatana-indicator-datetime-7823baf6ae4d84d7796bd003f2c3f0bb0122d126.tar.gz ayatana-indicator-datetime-7823baf6ae4d84d7796bd003f2c3f0bb0122d126.tar.bz2 ayatana-indicator-datetime-7823baf6ae4d84d7796bd003f2c3f0bb0122d126.zip |
Tried using uint but still segfaulting in variant code
-rw-r--r-- | src/datetime-service.c | 2 | ||||
-rw-r--r-- | src/indicator-datetime.c | 9 |
2 files changed, 9 insertions, 2 deletions
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); |