summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/calcurse.c4
-rw-r--r--src/io.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/src/calcurse.c b/src/calcurse.c
index 2c5cd9f..8e1978e 100644
--- a/src/calcurse.c
+++ b/src/calcurse.c
@@ -619,7 +619,11 @@ int main(int argc, char **argv)
config_load();
wins_erase_status_bar();
io_load_keys(conf.pager);
+
+ run_hook("pre-load");
io_load_data(NULL);
+ run_hook("post-load");
+
io_unset_modified();
wins_slctd_set(conf.default_panel);
wins_resize();
diff --git a/src/io.c b/src/io.c
index cc2cb28..d358263 100644
--- a/src/io.c
+++ b/src/io.c
@@ -893,12 +893,10 @@ void io_load_todo(struct item_filter *filter)
/* Load appointments and todo items */
void io_load_data(struct item_filter *filter)
{
- run_hook("pre-load");
io_mutex_lock();
io_load_app(filter);
io_load_todo(filter);
io_mutex_unlock();
- run_hook("post-load");
}
int io_reload_data(void)
@@ -934,6 +932,8 @@ int io_reload_data(void)
}
}
+ run_hook("pre-load");
+
if (!io_check_data_files_modified())
goto cleanup;
@@ -962,6 +962,8 @@ int io_reload_data(void)
ui_todo_sel_reset();
io_load_data(NULL);
+ run_hook("post-load");
+
io_unset_modified();
ui_todo_load_items();
ui_todo_sel_reset();