summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2016-01-13 08:10:53 +0100
committerLukas Fleischer <lfleischer@calcurse.org>2016-01-13 17:39:44 +0100
commit5f344e177fd9d6f4ed19068af009f583abb46b78 (patch)
tree4c3cc345e5a9dd35429b46779ff36a602c582a09 /src
parent0053dd5cdcaaaf5b1d0422ce63787cd086b5f3de (diff)
downloadcalcurse-5f344e177fd9d6f4ed19068af009f583abb46b78.tar.gz
calcurse-5f344e177fd9d6f4ed19068af009f583abb46b78.zip
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 <lfleischer@calcurse.org>
Diffstat (limited to 'src')
-rw-r--r--src/ical.c9
1 files changed, 6 insertions, 3 deletions
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);
}