summaryrefslogtreecommitdiff
path: root/apps
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 /apps
parent7a9910ccb9d67aed276778cf1bdb48ebcc3fed38 (diff)
downloadrockbox-66b45eeb596af1bd950832cd16b3752430f691c4.zip
rockbox-66b45eeb596af1bd950832cd16b3752430f691c4.tar.gz
rockbox-66b45eeb596af1bd950832cd16b3752430f691c4.tar.bz2
rockbox-66b45eeb596af1bd950832cd16b3752430f691c4.tar.xz
Added check for missing .rockbox directory to playlist code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5063 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-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 8d4f62d..5725c4b 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -247,10 +247,17 @@ static void create_control(struct playlist_info* playlist)
playlist->control_fd = creat(playlist->control_filename, 0000200);
if (playlist->control_fd < 0)
{
- splash(HZ*2, true, "%s (%d)", str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR),
- playlist->control_fd);
+ if (check_rockboxdir())
+ {
+ splash(HZ*2, true, "%s (%d)", str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR),
+ playlist->control_fd);
+ }
+ playlist->control_created = false;
+ }
+ else
+ {
+ playlist->control_created = true;
}
- playlist->control_created = true;
}
/*
diff --git a/apps/tree.c b/apps/tree.c
index 7be258c..90d7010 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -120,20 +120,27 @@ static bool boot_changed = false;
static bool start_wps = false;
static bool dirbrowse(const char *root, const int *dirfilter);
-void browse_root(void)
+bool check_rockboxdir(void)
{
- filetype_init();
-
-#ifndef SIMULATOR
DIR *dir = opendir(ROCKBOX_DIR);
if(!dir)
{
lcd_clear_display();
- splash(HZ*5, true, str(LANG_NO_ROCKBOX_DIR));
+ splash(HZ*2, true, str(LANG_NO_ROCKBOX_DIR));
lcd_clear_display();
- splash(HZ*5, true, str(LANG_INSTALLATION_INCOMPLETE));
+ splash(HZ*2, true, str(LANG_INSTALLATION_INCOMPLETE));
+ return false;
}
closedir(dir);
+ return true;
+}
+
+void browse_root(void)
+{
+ filetype_init();
+ check_rockboxdir();
+
+#ifndef SIMULATOR
dirbrowse("/", &global_settings.dirfilter);
#else
diff --git a/apps/tree.h b/apps/tree.h
index 5a618a8..dd08ca9 100644
--- a/apps/tree.h
+++ b/apps/tree.h
@@ -59,5 +59,6 @@ char *getcwd(char *buf, int size);
void reload_directory(void);
struct entry* load_and_sort_directory(const char *dirname, const int *dirfilter,
int *num_files, bool *buffer_full);
+bool check_rockboxdir(void);
#endif