diff options
author | karl-qdh <karl@qdh.org.uk> | 2011-03-29 14:23:29 +0100 |
---|---|---|
committer | karl-qdh <karl@qdh.org.uk> | 2011-03-29 14:23:29 +0100 |
commit | 26fddf955899a2751b140a8c5a75f6861509b66e (patch) | |
tree | 793f7fbd33f26814d8386b3d8e2a273da7c3b182 /src/datetime-service.c | |
parent | 37128f74bece1fea1d16503593546ce936568ae1 (diff) | |
download | ayatana-indicator-datetime-26fddf955899a2751b140a8c5a75f6861509b66e.tar.gz ayatana-indicator-datetime-26fddf955899a2751b140a8c5a75f6861509b66e.tar.bz2 ayatana-indicator-datetime-26fddf955899a2751b140a8c5a75f6861509b66e.zip |
Adding tedg's suggested change to the property sending, no change in signals being received by the other side.
Diffstat (limited to 'src/datetime-service.c')
-rw-r--r-- | src/datetime-service.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c index 17745fe..b0298ae 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -607,7 +607,7 @@ update_appointment_menu_items (gpointer user_data) int days[12]={31,28,31,30,31,30,31,31,30,31,30,31}; if ((this_year % 400 == 0) || (this_year % 100 > 0 && this_year % 4 == 0)) days[1] = 29; - int highlightdays = days[mon] - mday + 1; + int highlightdays = days[mon] - mday; t1 = curtime; // By default the current time is the appointment start time. if (start_time_appointments > 0) { @@ -627,10 +627,7 @@ update_appointment_menu_items (gpointer user_data) g_debug("Will highlight %d days from %s", highlightdays, ctime(&t1)); - t2 = t1 + (time_t) (highlightdays * 24 * 60 * 60); - - // Remove all highlights from the calendar widget - dbusmenu_menuitem_property_set (calendar, CALENDAR_MENUITEM_PROP_CLEAR_MARKS, NULL); + t2 = t1 + (time_t) (highlightdays * 24 * 60 * 60); if (!e_cal_get_sources(&sources, E_CAL_SOURCE_TYPE_EVENT, &gerror)) { g_debug("Failed to get ecal sources\n"); @@ -702,6 +699,11 @@ update_appointment_menu_items (gpointer user_data) } else { apt_output = SETTINGS_TIME_LOCALE; } + // Remove all highlights from the calendar widget + dbusmenu_menuitem_property_set (calendar, CALENDAR_MENUITEM_PROP_CLEAR_MARKS, NULL); + + GVariantBuilder markeddays; + g_variant_builder_init (&markeddays, G_VARIANT_TYPE_ARRAY); i = 0; for (l = sorted_comp_instances; l; l = l->next) { @@ -724,9 +726,8 @@ update_appointment_menu_items (gpointer user_data) const int dyear = due->tm_year; // Mark day - g_debug("Marking date %s", ctime(&ci->start)); - dbusmenu_menuitem_property_set_int (calendar, CALENDAR_MENUITEM_PROP_MARK, due->tm_mday); - + g_debug("Adding marked date %s, %d", ctime(&ci->start), dmday); + g_variant_builder_add (&markeddays, "i", dmday); // If the appointment time is less than the selected date, // don't create an appointment item for it. @@ -854,6 +855,9 @@ update_appointment_menu_items (gpointer user_data) } g_list_free(sorted_comp_instances); + GVariant * marks = g_variant_builder_end (&markeddays); + dbusmenu_menuitem_property_set_variant (calendar, CALENDAR_MENUITEM_PROP_MARK, marks); + updating_appointments = FALSE; g_debug("End of objects"); return TRUE; |