summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/calcurse.h2
-rw-r--r--src/interaction.c2
-rw-r--r--src/todo.c8
3 files changed, 3 insertions, 9 deletions
diff --git a/src/calcurse.h b/src/calcurse.h
index 1fd6010..714852e 100644
--- a/src/calcurse.h
+++ b/src/calcurse.h
@@ -905,7 +905,7 @@ int todo_hilt_pos(void);
char *todo_saved_mesg(void);
struct todo *todo_add(char *, int, char *);
void todo_write(struct todo *, FILE *);
-void todo_delete_note_bynum(unsigned);
+void todo_delete_note(struct todo *);
void todo_delete(struct todo *);
void todo_flag(struct todo *);
void todo_chg_priority(struct todo *, int);
diff --git a/src/interaction.c b/src/interaction.c
index 829e778..feff4d8 100644
--- a/src/interaction.c
+++ b/src/interaction.c
@@ -684,7 +684,7 @@ void interact_todo_delete(void)
todo_first_decrease(1);
break;
case 2:
- todo_delete_note_bynum(todo_hilt() - 1);
+ todo_delete_note(todo_get_item(todo_hilt()));
break;
default:
wins_erase_status_bar();
diff --git a/src/todo.c b/src/todo.c
index 191a2ac..ae5a81e 100644
--- a/src/todo.c
+++ b/src/todo.c
@@ -156,14 +156,8 @@ void todo_write(struct todo *todo, FILE * f)
}
/* Delete a note previously attached to a todo item. */
-void todo_delete_note_bynum(unsigned num)
+void todo_delete_note(struct todo *todo)
{
- llist_item_t *i = LLIST_NTH(&todolist, num);
-
- if (!i)
- EXIT(_("no such todo"));
- struct todo *todo = LLIST_TS_GET_DATA(i);
-
if (!todo->note)
EXIT(_("no note attached"));
erase_note(&todo->note);