diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2011-11-28 10:58:15 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2011-11-28 10:58:15 +0000 |
commit | d66592bad11b09ede186751a0fa1751feb29c15f (patch) | |
tree | 103c73932fe4a83df04d8b47020449f3faa72c0c /apps | |
parent | 25bce232f2883d2bba47fa9b908d1b95ee71cd3a (diff) |
Be less smart about when to reload skins as it caused more problems than it was worth. If any theme setting is loading from a .cfg reload all skins. Fixes FS#12410
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31081 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/gui/skin_engine/skin_engine.c | 25 | ||||
-rw-r--r-- | apps/settings.c | 8 |
2 files changed, 14 insertions, 19 deletions
diff --git a/apps/gui/skin_engine/skin_engine.c b/apps/gui/skin_engine/skin_engine.c index e28e4fbbf4..30ec0e75b8 100644 --- a/apps/gui/skin_engine/skin_engine.c +++ b/apps/gui/skin_engine/skin_engine.c @@ -139,29 +139,20 @@ void settings_apply_skins(void) { FOR_NB_SCREENS(j) { - bool load = false; get_skin_filename(filename, MAX_PATH, i,j); - if (filename[0] && (strcmp(filename, skins[i][j].filename) || skins[i][j].failsafe_loaded)) - load = true; - else if (first_run || (!filename[0] && !skins[i][j].failsafe_loaded)) - load = true; - - if (load) + if (!first_run) { - if (!first_run) - { - skin_data_free_buflib_allocs(&skins[i][j].data); + skin_data_free_buflib_allocs(&skins[i][j].data); #ifdef HAVE_BACKDROP_IMAGE - if (skins[i][j].data.backdrop_id >= 0) - skin_backdrop_unload(skins[i][j].data.backdrop_id); + if (skins[i][j].data.backdrop_id >= 0) + skin_backdrop_unload(skins[i][j].data.backdrop_id); #endif - } - gui_skin_reset(&skins[i][j]); - skins[i][j].gui_wps.display = &screens[j]; - if (skin_helpers[i].load_on_boot) - skin_get_gwps(i, j); } + gui_skin_reset(&skins[i][j]); + skins[i][j].gui_wps.display = &screens[j]; + if (skin_helpers[i].load_on_boot) + skin_get_gwps(i, j); } } first_run = false; diff --git a/apps/settings.c b/apps/settings.c index 3c28d316b5..408e377e1a 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -268,6 +268,7 @@ bool settings_load_config(const char* file, bool apply) char* name; char* value; int i; + bool theme_changed = false; fd = open_utf8(file, O_RDONLY); if (fd < 0) return false; @@ -275,13 +276,15 @@ bool settings_load_config(const char* file, bool apply) while (read_line(fd, line, sizeof line) > 0) { if (!settings_parseline(line, &name, &value)) - continue; + continue; for(i=0; i<nb_settings; i++) { if (settings[i].cfg_name == NULL) continue; if (!strcasecmp(name,settings[i].cfg_name)) { + if (settings[i].flags&F_THEMESETTING) + theme_changed = true; switch (settings[i].flags&F_T_MASK) { case F_T_CUSTOM: @@ -363,7 +366,8 @@ bool settings_load_config(const char* file, bool apply) { settings_save(); settings_apply(true); - settings_apply_skins(); + if (theme_changed) + settings_apply_skins(); } return true; } |