diff options
author | Lukas Fleischer <lfleischer@calcurse.org> | 2016-01-13 08:10:53 +0100 |
---|---|---|
committer | Lukas Fleischer <lfleischer@calcurse.org> | 2016-01-13 17:39:44 +0100 |
commit | 5f344e177fd9d6f4ed19068af009f583abb46b78 (patch) | |
tree | 4c3cc345e5a9dd35429b46779ff36a602c582a09 /src | |
parent | 0053dd5cdcaaaf5b1d0422ce63787cd086b5f3de (diff) | |
download | calcurse-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.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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); } |