forked from len0rd/rockbox
Added check for missing .rockbox directory to playlist code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5063 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
7a9910ccb9
commit
66b45eeb59
3 changed files with 24 additions and 9 deletions
|
@ -246,11 +246,18 @@ static void create_control(struct playlist_info* playlist)
|
||||||
{
|
{
|
||||||
playlist->control_fd = creat(playlist->control_filename, 0000200);
|
playlist->control_fd = creat(playlist->control_filename, 0000200);
|
||||||
if (playlist->control_fd < 0)
|
if (playlist->control_fd < 0)
|
||||||
|
{
|
||||||
|
if (check_rockboxdir())
|
||||||
{
|
{
|
||||||
splash(HZ*2, true, "%s (%d)", str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR),
|
splash(HZ*2, true, "%s (%d)", str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR),
|
||||||
playlist->control_fd);
|
playlist->control_fd);
|
||||||
}
|
}
|
||||||
|
playlist->control_created = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
playlist->control_created = true;
|
playlist->control_created = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
19
apps/tree.c
19
apps/tree.c
|
@ -120,20 +120,27 @@ static bool boot_changed = false;
|
||||||
static bool start_wps = false;
|
static bool start_wps = false;
|
||||||
static bool dirbrowse(const char *root, const int *dirfilter);
|
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);
|
DIR *dir = opendir(ROCKBOX_DIR);
|
||||||
if(!dir)
|
if(!dir)
|
||||||
{
|
{
|
||||||
lcd_clear_display();
|
lcd_clear_display();
|
||||||
splash(HZ*5, true, str(LANG_NO_ROCKBOX_DIR));
|
splash(HZ*2, true, str(LANG_NO_ROCKBOX_DIR));
|
||||||
lcd_clear_display();
|
lcd_clear_display();
|
||||||
splash(HZ*5, true, str(LANG_INSTALLATION_INCOMPLETE));
|
splash(HZ*2, true, str(LANG_INSTALLATION_INCOMPLETE));
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void browse_root(void)
|
||||||
|
{
|
||||||
|
filetype_init();
|
||||||
|
check_rockboxdir();
|
||||||
|
|
||||||
|
#ifndef SIMULATOR
|
||||||
dirbrowse("/", &global_settings.dirfilter);
|
dirbrowse("/", &global_settings.dirfilter);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -59,5 +59,6 @@ char *getcwd(char *buf, int size);
|
||||||
void reload_directory(void);
|
void reload_directory(void);
|
||||||
struct entry* load_and_sort_directory(const char *dirname, const int *dirfilter,
|
struct entry* load_and_sort_directory(const char *dirname, const int *dirfilter,
|
||||||
int *num_files, bool *buffer_full);
|
int *num_files, bool *buffer_full);
|
||||||
|
bool check_rockboxdir(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue