conf: added config_get_path()

config_get_path() is an simpler interface than parseConfigFilePath().
This commit is contained in:
Max Kellermann
2009-01-18 17:54:46 +01:00
parent a3f03f3ccd
commit 9c6b2a32f5
3 changed files with 32 additions and 5 deletions

View File

@@ -81,19 +81,20 @@ struct notify main_notify;
static void openDB(Options * options, char *argv0)
{
struct config_param *param;
const char *path = config_get_path(CONF_DB_FILE);
param = parseConfigFilePath(CONF_DB_FILE,
mapper_has_music_directory());
if (!mapper_has_music_directory()) {
if (param != NULL)
if (path != NULL)
g_message("Found " CONF_DB_FILE " setting without "
CONF_MUSIC_DIR " - disabling database");
db_init(NULL);
return;
}
db_init(param->value);
if (path == NULL)
g_error(CONF_DB_FILE " setting missing");
db_init(path);
if (options->createDB > 0 || !db_load()) {
unsigned job;