1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Index: apps/main.c
===================================================================
--- apps/main.c	(revision 30619)
+++ apps/main.c	(working copy)
@@ -373,19 +373,18 @@
 #ifdef DEBUG
     debug_init();
 #endif
+    storage_init();
+    settings_reset();
+    settings_load(SETTINGS_ALL);
+    settings_apply(true);
+    init_dircache(true);
+    init_dircache(false);
     /* Keep the order of this 3 (viewportmanager handles statusbars)
      * Must be done before any code uses the multi-screen API */
     gui_syncstatusbar_init(&statusbars);
     gui_sync_skin_init();
     sb_skin_init();
     viewportmanager_init();
-
-    storage_init();
-    settings_reset();
-    settings_load(SETTINGS_ALL);
-    settings_apply(true);
-    init_dircache(true);
-    init_dircache(false);
 #ifdef HAVE_TAGCACHE
     init_tagcache();
 #endif
@@ -511,21 +510,6 @@
     radio_init();
 #endif
 
-    /* Keep the order of this 3 (viewportmanager handles statusbars)
-     * Must be done before any code uses the multi-screen API */
-    CHART(">gui_syncstatusbar_init");
-    gui_syncstatusbar_init(&statusbars);
-    CHART("<gui_syncstatusbar_init");
-    CHART(">sb_skin_init");
-    sb_skin_init();
-    CHART("<sb_skin_init");
-    CHART(">gui_sync_wps_init");
-    gui_sync_skin_init();
-    CHART("<gui_sync_wps_init");
-    CHART(">viewportmanager_init");
-    viewportmanager_init();
-    CHART("<viewportmanager_init");
-
 #if CONFIG_CHARGING && (CONFIG_CPU == SH7034)
     /* charger_inserted() can't be used here because power_thread()
        hasn't checked power_input_status() yet */
@@ -668,6 +652,22 @@
         CHART("<eeprom_settings_store");
     }
 #endif
+
+    /* Keep the order of this 3 (viewportmanager handles statusbars)
+     * Must be done before any code uses the multi-screen API */
+    CHART(">gui_syncstatusbar_init");
+    gui_syncstatusbar_init(&statusbars);
+    CHART("<gui_syncstatusbar_init");
+    CHART(">sb_skin_init");
+    sb_skin_init();
+    CHART("<sb_skin_init");
+    CHART(">gui_sync_wps_init");
+    gui_sync_skin_init();
+    CHART("<gui_sync_wps_init");
+    CHART(">viewportmanager_init");
+    viewportmanager_init();
+    CHART("<viewportmanager_init");
+
     playlist_init();
     tree_mem_init();
     filetype_init();