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>
This commit is contained in:
parent
0053dd5cdc
commit
5f344e177f
@ -230,11 +230,14 @@ static void ical_export_todo(FILE * stream)
|
|||||||
|
|
||||||
LLIST_FOREACH(&todolist, i) {
|
LLIST_FOREACH(&todolist, i) {
|
||||||
struct todo *todo = LLIST_TS_GET_DATA(i);
|
struct todo *todo = LLIST_TS_GET_DATA(i);
|
||||||
if (todo->id < 0) /* completed items */
|
int priority = todo->id;
|
||||||
continue;
|
|
||||||
|
|
||||||
fputs("BEGIN:VTODO\n", stream);
|
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);
|
fprintf(stream, "SUMMARY:%s\n", todo->mesg);
|
||||||
fputs("END:VTODO\n", stream);
|
fputs("END:VTODO\n", stream);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user