mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
Get rid of get_user_file_path and do the path handling in wrappers for open() and friends.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28752 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
c35b43b0f5
commit
2c2416094f
25 changed files with 311 additions and 288 deletions
|
@ -219,15 +219,14 @@ static void read_config(const char* config_file);
|
|||
* load a colors file from a theme with:
|
||||
* filetype colours: filename.colours */
|
||||
void read_color_theme_file(void) {
|
||||
char buffer[MAX_PATH], dir[MAX_PATH];
|
||||
char buffer[MAX_PATH];
|
||||
int fd;
|
||||
char *ext, *color;
|
||||
int i;
|
||||
for (i = 0; i < MAX_FILETYPES+1; i++) {
|
||||
custom_colors[i] = -1;
|
||||
}
|
||||
snprintf(buffer, MAX_PATH, "%s/%s.colours",
|
||||
get_user_file_path(THEME_DIR, 0, dir, sizeof(dir)),
|
||||
snprintf(buffer, MAX_PATH, THEME_DIR "/%s.colours",
|
||||
global_settings.colors_file);
|
||||
fd = open(buffer, O_RDONLY);
|
||||
if (fd < 0)
|
||||
|
@ -300,7 +299,6 @@ void read_viewer_theme_file(void)
|
|||
|
||||
void filetype_init(void)
|
||||
{
|
||||
char path[MAX_PATH];
|
||||
/* set the directory item first */
|
||||
filetypes[0].extension = NULL;
|
||||
filetypes[0].plugin = NULL;
|
||||
|
@ -310,7 +308,7 @@ void filetype_init(void)
|
|||
viewer_count = 0;
|
||||
filetype_count = 1;
|
||||
read_builtin_types();
|
||||
read_config(get_user_file_path(VIEWERS_CONFIG, IS_FILE, path, sizeof(path)));
|
||||
read_config(VIEWERS_CONFIG);
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
read_viewer_theme_file();
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue