summaryrefslogtreecommitdiffstats
path: root/apps/playlist_catalog.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2008-01-29 06:57:54 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2008-01-29 06:57:54 +0000
commitba75e6038f3f9af54bdeaf9feb1f4bd90c042f19 (patch)
tree3fe37150d6c954d49761f75482e749561982b00e /apps/playlist_catalog.c
parent1d095d1545fcbd74d201a5d63cee654fe9141187 (diff)
downloadrockbox-ba75e6038f3f9af54bdeaf9feb1f4bd90c042f19.tar.gz
rockbox-ba75e6038f3f9af54bdeaf9feb1f4bd90c042f19.tar.bz2
rockbox-ba75e6038f3f9af54bdeaf9feb1f4bd90c042f19.zip
Move the playlist catalog config into the standard config files. 1 less disk spinup when the playlist cataloge is used the first time.
The manual doesnt currently mention this setting (or ever did). use "playlist catalog directory:/path/to/Playlists" in the .cfg git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16181 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/playlist_catalog.c')
-rw-r--r--apps/playlist_catalog.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/apps/playlist_catalog.c b/apps/playlist_catalog.c
index f5c5bcb35b..c68371af49 100644
--- a/apps/playlist_catalog.c
+++ b/apps/playlist_catalog.c
@@ -40,8 +40,6 @@
#include "filetypes.h"
#include "debug.h"
-#define PLAYLIST_CATALOG_CFG ROCKBOX_DIR "/playlist_catalog.config"
-#define PLAYLIST_CATALOG_DEFAULT_DIR "/Playlists"
#define MAX_PLAYLISTS 400
#define PLAYLIST_DISPLAY_COUNT 10
@@ -54,8 +52,7 @@ struct add_track_context {
/* keep track of most recently used playlist */
static char most_recent_playlist[MAX_PATH];
-/* directory where our playlists our stored (configured in
- PLAYLIST_CATALOG_CFG) */
+/* directory where our playlists our stored */
static char playlist_dir[MAX_PATH];
static int playlist_dir_length;
static bool playlist_dir_exists = false;
@@ -67,31 +64,15 @@ static int initialize_catalog(void)
if (!initialized)
{
- int f;
DIR* dir;
bool default_dir = true;
- f = open(PLAYLIST_CATALOG_CFG, O_RDONLY);
- if (f >= 0)
+
+ /* directory config is of the format: "dir: /path/to/dir" */
+ if (global_settings.playlist_catalog_dir[0])
{
- char buf[MAX_PATH+5];
-
- while (read_line(f, buf, sizeof(buf)))
- {
- char* name;
- char* value;
-
- /* directory config is of the format: "dir: /path/to/dir" */
- if (settings_parseline(buf, &name, &value) &&
- !strncasecmp(name, "dir:", strlen(name)) &&
- strlen(value) > 0)
- {
- strncpy(playlist_dir, value, strlen(value));
- default_dir = false;
- }
- }
-
- close(f);
+ strcpy(playlist_dir, global_settings.playlist_catalog_dir);
+ default_dir = false;
}
/* fall back to default directory if no or invalid config */