aboutsummaryrefslogtreecommitdiffstats
path: root/src/calcurse.c
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2017-09-08 07:44:35 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2017-09-08 21:08:54 +0200
commit57dd3d6b66156936d170893765d45a169e7010af (patch)
tree934958fe226dfb8655884a6d0aca739809c53ba4 /src/calcurse.c
parentba85d9b6f5e9854c7d4ec47e2a91b53e7f454f21 (diff)
downloadcalcurse-57dd3d6b66156936d170893765d45a169e7010af.tar.gz
calcurse-57dd3d6b66156936d170893765d45a169e7010af.zip
Only reload if data files were changed
Instead of blindly reloading data in io_reload_data(), compare the stored hashes of the data files with hashes of the current file contents and only reload if any of the hashes differs. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/calcurse.c')
-rw-r--r--src/calcurse.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/calcurse.c b/src/calcurse.c
index 5c77bca..bdd1761 100644
--- a/src/calcurse.c
+++ b/src/calcurse.c
@@ -277,11 +277,12 @@ static inline void key_generic_save(void)
static inline void key_generic_reload(void)
{
- io_reload_data();
- do_storage(0);
- notify_check_next_app(1);
- ui_calendar_monthly_view_cache_set_invalid();
- wins_update(FLAG_ALL);
+ if (io_reload_data()) {
+ do_storage(0);
+ notify_check_next_app(1);
+ ui_calendar_monthly_view_cache_set_invalid();
+ wins_update(FLAG_ALL);
+ }
}
static inline void key_generic_import(void)