diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2012-06-26 13:29:54 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2012-06-30 14:34:35 +0200 |
commit | 02c90ba53a658686bad5cb5f88c555d9eef06399 (patch) | |
tree | 4c9676d9e1bb703bb757cd05c6ce273e073e5c0e /src/todo.c | |
parent | e1fbee0071ad6bb5d5c17865c5a7b67a63930e7d (diff) | |
download | calcurse-02c90ba53a658686bad5cb5f88c555d9eef06399.zip |
Revise *_delete{,_bynum}()
Always pass an item instead of passing a date and a index. This makes
use of the NULL callback that was added with one of the previous
patches.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/todo.c')
-rw-r--r-- | src/todo.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -170,13 +170,12 @@ void todo_delete_note_bynum(unsigned num) } /* Delete an item from the todo linked list. */ -void todo_delete_bynum(unsigned num) +void todo_delete(struct todo *todo) { - llist_item_t *i = LLIST_NTH(&todolist, num); + llist_item_t *i = LLIST_FIND_FIRST(&todolist, todo, NULL); if (!i) EXIT(_("no such todo")); - struct todo *todo = LLIST_TS_GET_DATA(i); LLIST_REMOVE(&todolist, i); mem_free(todo->mesg); @@ -250,7 +249,7 @@ void todo_chg_priority(int action) /* NOTREACHED */ } - todo_delete_bynum(hilt - 1); + todo_delete(todo_get_item(hilt)); backup = todo_add(backup_mesg, backup_id, backup_note); hilt = todo_get_position(backup); } |