From 5f344e177fd9d6f4ed19068af009f583abb46b78 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Wed, 13 Jan 2016 08:10:53 +0100 Subject: ical: Export completed todo items properly Do not skip completed todo items when exporting to an iCal file. Instead, mark them as "STATUS:COMPLETED". Signed-off-by: Lukas Fleischer --- src/ical.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ical.c b/src/ical.c index 6588ba9..3d9a712 100644 --- a/src/ical.c +++ b/src/ical.c @@ -230,11 +230,14 @@ static void ical_export_todo(FILE * stream) LLIST_FOREACH(&todolist, i) { struct todo *todo = LLIST_TS_GET_DATA(i); - if (todo->id < 0) /* completed items */ - continue; + int priority = todo->id; fputs("BEGIN:VTODO\n", stream); - fprintf(stream, "PRIORITY:%d\n", todo->id); + if (todo->id < 0) { + fprintf(stream, "STATUS:COMPLETED\n"); + priority = -priority; + } + fprintf(stream, "PRIORITY:%d\n", priority); fprintf(stream, "SUMMARY:%s\n", todo->mesg); fputs("END:VTODO\n", stream); } -- cgit v1.2.3-70-g09d2