summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2010-03-06 12:14:12 +0000
committerMagnus Holmgren <magnushol@gmail.com>2010-03-06 12:14:12 +0000
commita14f4acb0c9ecdb11845a84e6d83b1a7bdbd5c7b (patch)
tree1da03334463791e9b3c7e2f09102b9f856c3e565 /apps
parent8050d47a4e2c3a62160d617af1c1ca38382f1319 (diff)
downloadrockbox-a14f4acb0c9ecdb11845a84e6d83b1a7bdbd5c7b.zip
rockbox-a14f4acb0c9ecdb11845a84e6d83b1a7bdbd5c7b.tar.gz
rockbox-a14f4acb0c9ecdb11845a84e6d83b1a7bdbd5c7b.tar.bz2
rockbox-a14f4acb0c9ecdb11845a84e6d83b1a7bdbd5c7b.tar.xz
Restore the 'read_disk' flag for settings_apply that was removed in r24922. It is still needed to prevent uncessary disk I/O for fonts etc. Should fix FS#11071 (I haven't tested it on a HD-based player).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25042 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/quickscreen.c4
-rw-r--r--apps/main.c6
-rw-r--r--apps/menus/main_menu.c2
-rw-r--r--apps/menus/theme_menu.c4
-rw-r--r--apps/settings.c76
-rw-r--r--apps/settings.h2
6 files changed, 49 insertions, 45 deletions
diff --git a/apps/gui/quickscreen.c b/apps/gui/quickscreen.c
index 1a22f69..d092f0b 100644
--- a/apps/gui/quickscreen.c
+++ b/apps/gui/quickscreen.c
@@ -400,7 +400,7 @@ bool quick_screen_quick(int button_enter)
if (gui_syncquickscreen_run(&qs, button_enter))
{
settings_save();
- settings_apply();
+ settings_apply(false);
/* make sure repeat/shuffle/any other nasty ones get updated */
if ( oldrepeat != global_settings.repeat_mode &&
(audio_status() & AUDIO_STATUS_PLAY) )
@@ -437,7 +437,7 @@ bool quick_screen_f3(int button_enter)
if (gui_syncquickscreen_run(&qs, button_enter))
{
settings_save();
- settings_apply();
+ settings_apply(false);
}
return(0);
}
diff --git a/apps/main.c b/apps/main.c
index dd41559..e05bd7b 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -337,7 +337,7 @@ static void init(void)
storage_init();
settings_reset();
settings_load(SETTINGS_ALL);
- settings_apply();
+ settings_apply(false);
init_dircache(true);
init_dircache(false);
#ifdef HAVE_TAGCACHE
@@ -376,6 +376,7 @@ static void init(void)
audio_init();
button_clear_queue(); /* Empty the keyboard buffer */
+ settings_apply(true);
settings_apply_skins();
}
@@ -570,7 +571,7 @@ static void init(void)
#endif
}
- settings_apply();
+ settings_apply(false);
init_dircache(false);
#ifdef HAVE_TAGCACHE
init_tagcache();
@@ -635,6 +636,7 @@ static void init(void)
#ifdef HAVE_HOTSWAP_STORAGE_AS_MAIN
check_bootfile(false); /* remember write time and filesize */
#endif
+ settings_apply(true);
settings_apply_skins();
}
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c
index 2d3a65a..59a72e1 100644
--- a/apps/menus/main_menu.c
+++ b/apps/menus/main_menu.c
@@ -77,7 +77,7 @@ static int reset_settings(void)
case YESNO_YES:
settings_reset();
settings_save();
- settings_apply();
+ settings_apply(true);
settings_apply_skins();
break;
case YESNO_NO:
diff --git a/apps/menus/theme_menu.c b/apps/menus/theme_menu.c
index 7d2a05c..4427e4a 100644
--- a/apps/menus/theme_menu.c
+++ b/apps/menus/theme_menu.c
@@ -96,7 +96,7 @@ static int set_color_func(void* color)
res = (int)set_color(&screens[SCREEN_MAIN],str(colors[c].lang_id),
colors[c].setting, banned_color);
settings_save();
- settings_apply();
+ settings_apply(false);
return res;
}
@@ -109,7 +109,7 @@ static int reset_color(void)
global_settings.lst_color = LCD_DEFAULT_FG;
settings_save();
- settings_apply();
+ settings_apply(false);
return 0;
}
MENUITEM_FUNCTION(set_bg_col, MENU_FUNC_USEPARAM, ID2P(LANG_BACKGROUND_COLOR),
diff --git a/apps/settings.c b/apps/settings.c
index 954b7d3..51846fa 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -360,7 +360,7 @@ bool settings_load_config(const char* file, bool apply)
settings_save();
if (apply)
{
- settings_apply();
+ settings_apply(true);
settings_apply_skins();
}
return true;
@@ -741,7 +741,7 @@ void sound_settings_apply(void)
}
-void settings_apply(void)
+void settings_apply(bool read_disk)
{
char buf[64];
@@ -833,52 +833,54 @@ void settings_apply(void)
audiohw_enable_speaker(global_settings.speaker_enabled);
#endif
+ if (read_disk)
+ {
#ifdef HAVE_LCD_BITMAP
- /* fonts need to be loaded before the WPS */
- if (global_settings.font_file[0]
- && global_settings.font_file[0] != '-') {
- snprintf(buf, sizeof buf, FONT_DIR "/%s.fnt",
- global_settings.font_file);
- if (font_load(NULL, buf) < 0)
+ /* fonts need to be loaded before the WPS */
+ if (global_settings.font_file[0]
+ && global_settings.font_file[0] != '-') {
+ snprintf(buf, sizeof buf, FONT_DIR "/%s.fnt",
+ global_settings.font_file);
+ if (font_load(NULL, buf) < 0)
+ font_reset(NULL);
+ }
+ else
font_reset(NULL);
- }
- else
- font_reset(NULL);
#ifdef HAVE_REMOTE_LCD
- if ( global_settings.remote_font_file[0]
- && global_settings.remote_font_file[0] != '-') {
- snprintf(buf, sizeof buf, FONT_DIR "/%s.fnt",
- global_settings.remote_font_file);
- if (font_load_remoteui(buf) < 0)
+ if ( global_settings.remote_font_file[0]
+ && global_settings.remote_font_file[0] != '-') {
+ snprintf(buf, sizeof buf, FONT_DIR "/%s.fnt",
+ global_settings.remote_font_file);
+ if (font_load_remoteui(buf) < 0)
+ font_load_remoteui(NULL);
+ }
+ else
font_load_remoteui(NULL);
- }
- else
- font_load_remoteui(NULL);
#endif
- if ( global_settings.kbd_file[0]) {
- snprintf(buf, sizeof buf, ROCKBOX_DIR "/%s.kbd",
- global_settings.kbd_file);
- load_kbd(buf);
- }
- else
- load_kbd(NULL);
+ if ( global_settings.kbd_file[0]) {
+ snprintf(buf, sizeof buf, ROCKBOX_DIR "/%s.kbd",
+ global_settings.kbd_file);
+ load_kbd(buf);
+ }
+ else
+ load_kbd(NULL);
#endif
- if ( global_settings.lang_file[0]) {
- snprintf(buf, sizeof buf, LANG_DIR "/%s.lng",
- global_settings.lang_file);
- lang_core_load(buf);
- talk_init(); /* use voice of same language */
- }
+ if ( global_settings.lang_file[0]) {
+ snprintf(buf, sizeof buf, LANG_DIR "/%s.lng",
+ global_settings.lang_file);
+ lang_core_load(buf);
+ talk_init(); /* use voice of same language */
+ }
- /* load the icon set */
- icons_init();
+ /* load the icon set */
+ icons_init();
#ifdef HAVE_LCD_COLOR
- if (global_settings.colors_file[0])
- read_color_theme_file();
+ if (global_settings.colors_file[0])
+ read_color_theme_file();
#endif
-
+ }
#ifdef HAVE_LCD_COLOR
screens[SCREEN_MAIN].set_foreground(global_settings.fg_color);
screens[SCREEN_MAIN].set_background(global_settings.bg_color);
diff --git a/apps/settings.h b/apps/settings.h
index 1186f47..4cc2bd5 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -260,7 +260,7 @@ void sound_settings_apply(void);
*/
void settings_apply_skins(void);
-void settings_apply(void);
+void settings_apply(bool read_disk);
void settings_apply_pm_range(void);
void settings_display(void);