summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Backe <henrik@backe.eu>2004-09-10 20:51:12 +0000
committerHenrik Backe <henrik@backe.eu>2004-09-10 20:51:12 +0000
commit66b45eeb596af1bd950832cd16b3752430f691c4 (patch)
tree25f5f0efe604a04842cce72a09001f1f9573cd0f
parent7a9910ccb9d67aed276778cf1bdb48ebcc3fed38 (diff)
downloadrockbox-66b45eeb596af1bd950832cd16b3752430f691c4.tar.gz
rockbox-66b45eeb596af1bd950832cd16b3752430f691c4.zip
Added check for missing .rockbox directory to playlist code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5063 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/playlist.c13
-rw-r--r--apps/tree.c19
-rw-r--r--apps/tree.h1
3 files changed, 24 insertions, 9 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 8d4f62db68..5725c4be85 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -247,10 +247,17 @@ static void create_control(struct playlist_info* playlist)
247 playlist->control_fd = creat(playlist->control_filename, 0000200); 247 playlist->control_fd = creat(playlist->control_filename, 0000200);
248 if (playlist->control_fd < 0) 248 if (playlist->control_fd < 0)
249 { 249 {
250 splash(HZ*2, true, "%s (%d)", str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR), 250 if (check_rockboxdir())
251 playlist->control_fd); 251 {
252 splash(HZ*2, true, "%s (%d)", str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR),
253 playlist->control_fd);
254 }
255 playlist->control_created = false;
256 }
257 else
258 {
259 playlist->control_created = true;
252 } 260 }
253 playlist->control_created = true;
254} 261}
255 262
256/* 263/*
diff --git a/apps/tree.c b/apps/tree.c
index 7be258c4db..90d7010d03 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -120,20 +120,27 @@ static bool boot_changed = false;
120static bool start_wps = false; 120static bool start_wps = false;
121static bool dirbrowse(const char *root, const int *dirfilter); 121static bool dirbrowse(const char *root, const int *dirfilter);
122 122
123void browse_root(void) 123bool check_rockboxdir(void)
124{ 124{
125 filetype_init();
126
127#ifndef SIMULATOR
128 DIR *dir = opendir(ROCKBOX_DIR); 125 DIR *dir = opendir(ROCKBOX_DIR);
129 if(!dir) 126 if(!dir)
130 { 127 {
131 lcd_clear_display(); 128 lcd_clear_display();
132 splash(HZ*5, true, str(LANG_NO_ROCKBOX_DIR)); 129 splash(HZ*2, true, str(LANG_NO_ROCKBOX_DIR));
133 lcd_clear_display(); 130 lcd_clear_display();
134 splash(HZ*5, true, str(LANG_INSTALLATION_INCOMPLETE)); 131 splash(HZ*2, true, str(LANG_INSTALLATION_INCOMPLETE));
132 return false;
135 } 133 }
136 closedir(dir); 134 closedir(dir);
135 return true;
136}
137
138void browse_root(void)
139{
140 filetype_init();
141 check_rockboxdir();
142
143#ifndef SIMULATOR
137 dirbrowse("/", &global_settings.dirfilter); 144 dirbrowse("/", &global_settings.dirfilter);
138 145
139#else 146#else
diff --git a/apps/tree.h b/apps/tree.h
index 5a618a8bc3..dd08ca9392 100644
--- a/apps/tree.h
+++ b/apps/tree.h
@@ -59,5 +59,6 @@ char *getcwd(char *buf, int size);
59void reload_directory(void); 59void reload_directory(void);
60struct entry* load_and_sort_directory(const char *dirname, const int *dirfilter, 60struct entry* load_and_sort_directory(const char *dirname, const int *dirfilter,
61 int *num_files, bool *buffer_full); 61 int *num_files, bool *buffer_full);
62bool check_rockboxdir(void);
62 63
63#endif 64#endif