From c23931edd4019965dea322ea753bcb5fda0b8be7 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 20 Jan 2009 04:51:47 +0000 Subject: [PATCH] * When saving a Task, if the status is COMPLETED then also set PERCENT-COMPLETE:100 so Kontact sees it as complete as well. (We probably should go the other way too, but that needs further discussion.) --- webcit/calendar.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/webcit/calendar.c b/webcit/calendar.c index d50e1f77e..d97750bbb 100644 --- a/webcit/calendar.c +++ b/webcit/calendar.c @@ -842,10 +842,19 @@ void save_individual_task(icalcomponent *supplied_vtodo, long msgnum, char* from icalcomponent_remove_property(vtodo,prop); icalproperty_free(prop); } + icalcomponent_remove_property(vtodo, + icalcomponent_get_first_property(vtodo, ICAL_PERCENTCOMPLETE_PROPERTY)); if (havebstr("status")) { - icalproperty_status taskStatus = icalproperty_string_to_status( - bstr("status")); + icalproperty_status taskStatus = icalproperty_string_to_status(bstr("status")); icalcomponent_set_status(vtodo, taskStatus); + icalcomponent_add_property(vtodo, + icalproperty_new_percentcomplete( + (strcasecmp(bstr("status"), "completed") ? 0 : 100) + ) + ); + } + else { + icalcomponent_add_property(vtodo, icalproperty_new_percentcomplete(0)); } while (prop = icalcomponent_get_first_property(vtodo, ICAL_CATEGORIES_PROPERTY), prop != NULL) { -- 2.39.2