summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/main.c3
-rw-r--r--apps/misc.c2
-rw-r--r--apps/tree.c24
3 files changed, 17 insertions, 12 deletions
diff --git a/apps/main.c b/apps/main.c
index 1d590286e2..a107d1cdd0 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -161,8 +161,9 @@ int init_dircache(bool preinit)
{
backlight_on();
show_logo();
- settings_save();
}
+ global_settings.dircache_size = dircache_get_cache_size();
+ settings_save();
}
return result;
diff --git a/apps/misc.c b/apps/misc.c
index 4ea8568018..75c4910d40 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -555,8 +555,8 @@ bool settings_parseline(char* line, char** name, char** value)
static void system_flush(void)
{
- call_ata_idle_notifys(true); /*doesnt work on usb and shutdown from ata thread */
tree_flush();
+ call_ata_idle_notifys(true); /*doesnt work on usb and shutdown from ata thread */
}
static void system_restore(void)
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
}