summaryrefslogtreecommitdiff
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
parent8050d47a4e2c3a62160d617af1c1ca38382f1319 (diff)
downloadrockbox-a14f4acb0c9ecdb11845a84e6d83b1a7bdbd5c7b.tar.gz
rockbox-a14f4acb0c9ecdb11845a84e6d83b1a7bdbd5c7b.zip
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
-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 1a22f69341..d092f0b04a 100644
--- a/apps/gui/quickscreen.c
+++ b/apps/gui/quickscreen.c
@@ -400,7 +400,7 @@ bool quick_screen_quick(int button_enter)
400 if (gui_syncquickscreen_run(&qs, button_enter)) 400 if (gui_syncquickscreen_run(&qs, button_enter))
401 { 401 {
402 settings_save(); 402 settings_save();
403 settings_apply(); 403 settings_apply(false);
404 /* make sure repeat/shuffle/any other nasty ones get updated */ 404 /* make sure repeat/shuffle/any other nasty ones get updated */
405 if ( oldrepeat != global_settings.repeat_mode && 405 if ( oldrepeat != global_settings.repeat_mode &&
406 (audio_status() & AUDIO_STATUS_PLAY) ) 406 (audio_status() & AUDIO_STATUS_PLAY) )
@@ -437,7 +437,7 @@ bool quick_screen_f3(int button_enter)
437 if (gui_syncquickscreen_run(&qs, button_enter)) 437 if (gui_syncquickscreen_run(&qs, button_enter))
438 { 438 {
439 settings_save(); 439 settings_save();
440 settings_apply(); 440 settings_apply(false);
441 } 441 }
442 return(0); 442 return(0);
443} 443}
diff --git a/apps/main.c b/apps/main.c
index dd41559328..e05bd7bdfa 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -337,7 +337,7 @@ static void init(void)
337 storage_init(); 337 storage_init();
338 settings_reset(); 338 settings_reset();
339 settings_load(SETTINGS_ALL); 339 settings_load(SETTINGS_ALL);
340 settings_apply(); 340 settings_apply(false);
341 init_dircache(true); 341 init_dircache(true);
342 init_dircache(false); 342 init_dircache(false);
343#ifdef HAVE_TAGCACHE 343#ifdef HAVE_TAGCACHE
@@ -376,6 +376,7 @@ static void init(void)
376 audio_init(); 376 audio_init();
377 button_clear_queue(); /* Empty the keyboard buffer */ 377 button_clear_queue(); /* Empty the keyboard buffer */
378 378
379 settings_apply(true);
379 settings_apply_skins(); 380 settings_apply_skins();
380} 381}
381 382
@@ -570,7 +571,7 @@ static void init(void)
570#endif 571#endif
571 } 572 }
572 573
573 settings_apply(); 574 settings_apply(false);
574 init_dircache(false); 575 init_dircache(false);
575#ifdef HAVE_TAGCACHE 576#ifdef HAVE_TAGCACHE
576 init_tagcache(); 577 init_tagcache();
@@ -635,6 +636,7 @@ static void init(void)
635#ifdef HAVE_HOTSWAP_STORAGE_AS_MAIN 636#ifdef HAVE_HOTSWAP_STORAGE_AS_MAIN
636 check_bootfile(false); /* remember write time and filesize */ 637 check_bootfile(false); /* remember write time and filesize */
637#endif 638#endif
639 settings_apply(true);
638 settings_apply_skins(); 640 settings_apply_skins();
639} 641}
640 642
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c
index 2d3a65a7b2..59a72e1ad7 100644
--- a/apps/menus/main_menu.c
+++ b/apps/menus/main_menu.c
@@ -77,7 +77,7 @@ static int reset_settings(void)
77 case YESNO_YES: 77 case YESNO_YES:
78 settings_reset(); 78 settings_reset();
79 settings_save(); 79 settings_save();
80 settings_apply(); 80 settings_apply(true);
81 settings_apply_skins(); 81 settings_apply_skins();
82 break; 82 break;
83 case YESNO_NO: 83 case YESNO_NO:
diff --git a/apps/menus/theme_menu.c b/apps/menus/theme_menu.c
index 7d2a05c67f..4427e4aeca 100644
--- a/apps/menus/theme_menu.c
+++ b/apps/menus/theme_menu.c
@@ -96,7 +96,7 @@ static int set_color_func(void* color)
96 res = (int)set_color(&screens[SCREEN_MAIN],str(colors[c].lang_id), 96 res = (int)set_color(&screens[SCREEN_MAIN],str(colors[c].lang_id),
97 colors[c].setting, banned_color); 97 colors[c].setting, banned_color);
98 settings_save(); 98 settings_save();
99 settings_apply(); 99 settings_apply(false);
100 return res; 100 return res;
101} 101}
102 102
@@ -109,7 +109,7 @@ static int reset_color(void)
109 global_settings.lst_color = LCD_DEFAULT_FG; 109 global_settings.lst_color = LCD_DEFAULT_FG;
110 110
111 settings_save(); 111 settings_save();
112 settings_apply(); 112 settings_apply(false);
113 return 0; 113 return 0;
114} 114}
115MENUITEM_FUNCTION(set_bg_col, MENU_FUNC_USEPARAM, ID2P(LANG_BACKGROUND_COLOR), 115MENUITEM_FUNCTION(set_bg_col, MENU_FUNC_USEPARAM, ID2P(LANG_BACKGROUND_COLOR),
diff --git a/apps/settings.c b/apps/settings.c
index 954b7d3dcf..51846fa2b2 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -360,7 +360,7 @@ bool settings_load_config(const char* file, bool apply)
360 settings_save(); 360 settings_save();
361 if (apply) 361 if (apply)
362 { 362 {
363 settings_apply(); 363 settings_apply(true);
364 settings_apply_skins(); 364 settings_apply_skins();
365 } 365 }
366 return true; 366 return true;
@@ -741,7 +741,7 @@ void sound_settings_apply(void)
741} 741}
742 742
743 743
744void settings_apply(void) 744void settings_apply(bool read_disk)
745{ 745{
746 746
747 char buf[64]; 747 char buf[64];
@@ -833,52 +833,54 @@ void settings_apply(void)
833 audiohw_enable_speaker(global_settings.speaker_enabled); 833 audiohw_enable_speaker(global_settings.speaker_enabled);
834#endif 834#endif
835 835
836 if (read_disk)
837 {
836#ifdef HAVE_LCD_BITMAP 838#ifdef HAVE_LCD_BITMAP
837 /* fonts need to be loaded before the WPS */ 839 /* fonts need to be loaded before the WPS */
838 if (global_settings.font_file[0] 840 if (global_settings.font_file[0]
839 && global_settings.font_file[0] != '-') { 841 && global_settings.font_file[0] != '-') {
840 snprintf(buf, sizeof buf, FONT_DIR "/%s.fnt", 842 snprintf(buf, sizeof buf, FONT_DIR "/%s.fnt",
841 global_settings.font_file); 843 global_settings.font_file);
842 if (font_load(NULL, buf) < 0) 844 if (font_load(NULL, buf) < 0)
845 font_reset(NULL);
846 }
847 else
843 font_reset(NULL); 848 font_reset(NULL);
844 }
845 else
846 font_reset(NULL);
847#ifdef HAVE_REMOTE_LCD 849#ifdef HAVE_REMOTE_LCD
848 if ( global_settings.remote_font_file[0] 850 if ( global_settings.remote_font_file[0]
849 && global_settings.remote_font_file[0] != '-') { 851 && global_settings.remote_font_file[0] != '-') {
850 snprintf(buf, sizeof buf, FONT_DIR "/%s.fnt", 852 snprintf(buf, sizeof buf, FONT_DIR "/%s.fnt",
851 global_settings.remote_font_file); 853 global_settings.remote_font_file);
852 if (font_load_remoteui(buf) < 0) 854 if (font_load_remoteui(buf) < 0)
855 font_load_remoteui(NULL);
856 }
857 else
853 font_load_remoteui(NULL); 858 font_load_remoteui(NULL);
854 }
855 else
856 font_load_remoteui(NULL);
857#endif 859#endif
858 if ( global_settings.kbd_file[0]) { 860 if ( global_settings.kbd_file[0]) {
859 snprintf(buf, sizeof buf, ROCKBOX_DIR "/%s.kbd", 861 snprintf(buf, sizeof buf, ROCKBOX_DIR "/%s.kbd",
860 global_settings.kbd_file); 862 global_settings.kbd_file);
861 load_kbd(buf); 863 load_kbd(buf);
862 } 864 }
863 else 865 else
864 load_kbd(NULL); 866 load_kbd(NULL);
865#endif 867#endif
866 868
867 if ( global_settings.lang_file[0]) { 869 if ( global_settings.lang_file[0]) {
868 snprintf(buf, sizeof buf, LANG_DIR "/%s.lng", 870 snprintf(buf, sizeof buf, LANG_DIR "/%s.lng",
869 global_settings.lang_file); 871 global_settings.lang_file);
870 lang_core_load(buf); 872 lang_core_load(buf);
871 talk_init(); /* use voice of same language */ 873 talk_init(); /* use voice of same language */
872 } 874 }
873 875
874 /* load the icon set */ 876 /* load the icon set */
875 icons_init(); 877 icons_init();
876 878
877#ifdef HAVE_LCD_COLOR 879#ifdef HAVE_LCD_COLOR
878 if (global_settings.colors_file[0]) 880 if (global_settings.colors_file[0])
879 read_color_theme_file(); 881 read_color_theme_file();
880#endif 882#endif
881 883 }
882#ifdef HAVE_LCD_COLOR 884#ifdef HAVE_LCD_COLOR
883 screens[SCREEN_MAIN].set_foreground(global_settings.fg_color); 885 screens[SCREEN_MAIN].set_foreground(global_settings.fg_color);
884 screens[SCREEN_MAIN].set_background(global_settings.bg_color); 886 screens[SCREEN_MAIN].set_background(global_settings.bg_color);
diff --git a/apps/settings.h b/apps/settings.h
index 1186f47fb0..4cc2bd521e 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -260,7 +260,7 @@ void sound_settings_apply(void);
260 */ 260 */
261void settings_apply_skins(void); 261void settings_apply_skins(void);
262 262
263void settings_apply(void); 263void settings_apply(bool read_disk);
264void settings_apply_pm_range(void); 264void settings_apply_pm_range(void);
265void settings_display(void); 265void settings_display(void);
266 266