diff options
| author | Miika Pekkarinen <miipekk@ihme.org> | 2006-12-22 09:11:09 +0000 |
|---|---|---|
| committer | Miika Pekkarinen <miipekk@ihme.org> | 2006-12-22 09:11:09 +0000 |
| commit | c8a9ca748d0a3b1961f6577159a9de8ac4af60e7 (patch) | |
| tree | 16f719514542087f5a2e0d5bac8d30b4fce5910a /apps/main.c | |
| parent | 7258b5e51a78e4d990bf1225c5893dc4b78d78b7 (diff) | |
| download | rockbox-c8a9ca748d0a3b1961f6577159a9de8ac4af60e7.zip rockbox-c8a9ca748d0a3b1961f6577159a9de8ac4af60e7.tar.gz rockbox-c8a9ca748d0a3b1961f6577159a9de8ac4af60e7.tar.bz2 rockbox-c8a9ca748d0a3b1961f6577159a9de8ac4af60e7.tar.xz | |
Try to make sure dircache state file on flashed H1xx targets is
handled correctly and no old state is never used.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11833 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/main.c')
| -rw-r--r-- | apps/main.c | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/apps/main.c b/apps/main.c index f9e6054..0b35a61 100644 --- a/apps/main.c +++ b/apps/main.c @@ -128,25 +128,32 @@ static int init_dircache(bool preinit) if (preinit) dircache_init(); - if (global_settings.dircache) - { + if (!global_settings.dircache) + return 0; + # ifdef HAVE_EEPROM_SETTINGS - if (firmware_settings.initialized && firmware_settings.disk_clean - && preinit) + if (firmware_settings.initialized && firmware_settings.disk_clean + && preinit) + { + result = dircache_load(); + + if (result < 0) { - result = dircache_load(DIRCACHE_FILE); - remove(DIRCACHE_FILE); - if (result < 0) + firmware_settings.disk_clean = false; + if (global_settings.dircache_size <= 0) { - firmware_settings.disk_clean = false; - if (global_settings.dircache_size >= 0) - dircache_build(global_settings.dircache_size); + /* This will be in default language, settings are not + applied yet. Not really any easy way to fix that. */ + gui_syncsplash(0, true, str(LANG_DIRCACHE_BUILDING)); + clear = true; } - - return result; + + dircache_build(global_settings.dircache_size); } + } + else # endif - + { if (preinit) return -1; @@ -163,12 +170,12 @@ static int init_dircache(bool preinit) if (result < 0) gui_syncsplash(0, true, "Failed! Result: %d", result); - - if (clear) - { - backlight_on(); - show_logo(); - } + } + + if (clear) + { + backlight_on(); + show_logo(); global_settings.dircache_size = dircache_get_cache_size(); settings_save(); } |