aboutsummaryrefslogtreecommitdiffstats
path: root/src/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/io.c')
-rw-r--r--src/io.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/io.c b/src/io.c
index fcb13ae..d25180a 100644
--- a/src/io.c
+++ b/src/io.c
@@ -684,8 +684,20 @@ void io_load_todo(struct item_filter *filter)
continue;
}
- todo_add(e_todo, id, note);
- ++nb_tod;
+ struct todo *todo = todo_add(e_todo, id, note);
+
+ /* Filter by hash. */
+ if (filter && filter->hash) {
+ char *hash = todo_hash(todo);
+ if (!hash_matches(filter->hash, hash)) {
+ todo_delete(todo);
+ todo = NULL;
+ }
+ mem_free(hash);
+ }
+
+ if (todo)
+ ++nb_tod;
}
file_close(data_file, __FILE_POS__);
}