From 8c2ccebe3500accf57675553a88f55496eec394a Mon Sep 17 00:00:00 2001 From: Lars Henriksen Date: Wed, 22 Aug 2018 10:03:35 +0200 Subject: Handling of modified flag The flag modified (io.c) keeps track of the memory state of data: modified == 0: unchanged since load or last save modified == 1: changed since load or last save It is now unset in io_load_data() and io_save_cal() only. Signed-off-by: Lars Henriksen Signed-off-by: Lukas Fleischer --- src/calcurse.c | 1 - src/io.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/calcurse.c b/src/calcurse.c index 920cbcd..5a08d53 100644 --- a/src/calcurse.c +++ b/src/calcurse.c @@ -626,7 +626,6 @@ int main(int argc, char **argv) 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 bb52bce..6e8ae55 100644 --- a/src/io.c +++ b/src/io.c @@ -905,6 +905,7 @@ void io_load_data(struct item_filter *filter) io_load_app(filter); io_load_todo(filter); io_mutex_unlock(); + io_unset_modified(); } int io_reload_data(void) @@ -958,9 +959,8 @@ int io_reload_data(void) todo_init_list(); io_load_data(NULL); - run_hook("post-load"); - io_unset_modified(); + run_hook("post-load"); if (show_dialogs()) { status_mesg(reload_success, enter); -- cgit v1.2.3-70-g09d2