From d66592bad11b09ede186751a0fa1751feb29c15f Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Mon, 28 Nov 2011 10:58:15 +0000 Subject: 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 --- apps/gui/skin_engine/skin_engine.c | 25 ++++++++----------------- apps/settings.c | 8 ++++++-- 2 files changed, 14 insertions(+), 19 deletions(-) (limited to 'apps') 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