aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkarl-qdh <karl@qdh.org.uk>2011-03-06 17:08:13 +0000
committerkarl-qdh <karl@qdh.org.uk>2011-03-06 17:08:13 +0000
commit7823baf6ae4d84d7796bd003f2c3f0bb0122d126 (patch)
treeecf5cda1a466a6abafded366799a698e728fea22 /src
parent9485b01a79c5a7ebe563986295acf24f6ce7df1a (diff)
downloadayatana-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
Diffstat (limited to 'src')
-rw-r--r--src/datetime-service.c2
-rw-r--r--src/indicator-datetime.c9
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);