summaryrefslogtreecommitdiffstats
path: root/apps/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/apps/tree.c b/apps/tree.c
index 17da91d72b..29bf75d074 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -1437,20 +1437,24 @@ void tree_flush(void)
#endif
#ifdef HAVE_DIRCACHE
- if (global_settings.dircache)
{
- global_settings.dircache_size = dircache_get_cache_size();
+ int old_val = global_settings.dircache_size;
+ if (global_settings.dircache)
+ {
+ global_settings.dircache_size = dircache_get_cache_size();
# ifdef HAVE_EEPROM_SETTINGS
- if (dircache_is_enabled() && firmware_settings.initialized)
- dircache_save(DIRCACHE_FILE);
+ if (dircache_is_enabled() && firmware_settings.initialized)
+ dircache_save(DIRCACHE_FILE);
# endif
- dircache_disable();
- }
- else
- {
- global_settings.dircache_size = 0;
+ dircache_disable();
+ }
+ else
+ {
+ global_settings.dircache_size = 0;
+ }
+ if (old_val != global_settings.dircache_size)
+ settings_save();
}
- settings_save();
#endif
}