summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-11-20 16:39:42 +0000
committerAmaury Pouly <amaury.pouly@gmail.com>2013-11-20 21:34:04 +0100
commit193753aa1f93ba28995a80048cbc46f1fc5cde05 (patch)
treeb5ff0ab364235dbd49e96ff48ebdedda6701c51d /apps
parentc71e0567d60af8e409ede4034d72e8accf98cb87 (diff)
downloadrockbox-193753aa1f93ba28995a80048cbc46f1fc5cde05.tar.gz
rockbox-193753aa1f93ba28995a80048cbc46f1fc5cde05.zip
Introduce volume_{present,removable} and fix invalid calls in apps/
The code was trying to probe for volume presence by calling drive layer with volume index. It is a miracle it get unnoticed so far. Introduce proper volume probing using the vol->drive map in the disk layer. Change-Id: I463a5bcc8170f007cad049536094207d2ba3c6fc Reviewed-on: http://gerrit.rockbox.org/669 Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/root_menu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/root_menu.c b/apps/root_menu.c
index 1ffde91eb7..71844dd41a 100644
--- a/apps/root_menu.c
+++ b/apps/root_menu.c
@@ -71,6 +71,7 @@
71#endif 71#endif
72#include "language.h" 72#include "language.h"
73#include "plugin.h" 73#include "plugin.h"
74#include "disk.h"
74 75
75struct root_items { 76struct root_items {
76 int (*function)(void* param); 77 int (*function)(void* param);
@@ -131,12 +132,12 @@ static int browser(void* param)
131 for (i = 0; i < NUM_VOLUMES; i++) 132 for (i = 0; i < NUM_VOLUMES; i++)
132 { 133 {
133 char vol_string[VOL_ENUM_POS + 8]; 134 char vol_string[VOL_ENUM_POS + 8];
134 if (!storage_removable(i)) 135 if (!volume_removable(i))
135 continue; 136 continue;
136 /* VOL_NAMES contains a %d */ 137 /* VOL_NAMES contains a %d */
137 snprintf(vol_string, sizeof(vol_string), "/"VOL_NAMES, i); 138 snprintf(vol_string, sizeof(vol_string), "/"VOL_NAMES, i);
138 /* test whether we would browse the external card */ 139 /* test whether we would browse the external card */
139 if (!storage_present(i) && 140 if (!volume_present(i) &&
140 (strstr(last_folder, vol_string) 141 (strstr(last_folder, vol_string)
141#ifdef HAVE_HOTSWAP_STORAGE_AS_MAIN 142#ifdef HAVE_HOTSWAP_STORAGE_AS_MAIN
142 || (i == 0) 143 || (i == 0)