]> git.sesse.net Git - vlc/commitdiff
Remove config_GetUserConfDir
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 24 Aug 2009 18:46:22 +0000 (21:46 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 24 Aug 2009 18:46:22 +0000 (21:46 +0300)
include/vlc_configuration.h
modules/misc/lua/libs/misc.c
src/config/dirs.c
src/config/file.c
src/libvlccore.sym

index e5df206260b961dca6ceadc36702a045fbd27ed8..30aa958674725f8e85afa6a53302f3d88d8faa42 100644 (file)
@@ -214,14 +214,15 @@ VLC_EXPORT( int,    __config_SaveConfigFile, ( vlc_object_t *, const char * ) );
 VLC_EXPORT( void,   __config_ResetAll, ( vlc_object_t * ) );
 
 VLC_EXPORT( module_config_t *, config_FindConfig,( vlc_object_t *, const char * ) LIBVLC_USED );
-
 VLC_EXPORT(const char *, config_GetDataDir, ( void ) LIBVLC_USED);
 VLC_EXPORT(const char *, config_GetConfDir, ( void ) LIBVLC_USED);
-VLC_EXPORT(char *, config_GetUserConfDir, ( void ) LIBVLC_USED);
 VLC_EXPORT(char *, config_GetUserDataDir, ( void ) LIBVLC_USED);
 
 typedef enum vlc_userdir {
+    /* User's home */
     VLC_HOME_DIR,
+    /* VLC configuration directory */
+    VLC_CONFIG_DIR,
 } vlc_userdir_t;
 
 VLC_EXPORT(char *, config_GetUserDir, ( vlc_userdir_t ) LIBVLC_USED);
index 1bbc1b0aad6a969705fcd1552cb4fca6761cdf4e..e080d2776cf6dc4bd36637c7366acd7e97590d4f 100644 (file)
@@ -134,7 +134,7 @@ static int vlclua_homedir( lua_State *L )
 
 static int vlclua_configdir( lua_State *L )
 {
-    char *dir = config_GetUserConfDir();
+    char *dir = config_GetUserDir( VLC_CONFIG_DIR );
     lua_pushstring( L, dir );
     free( dir );
     return 1;
index 341fe00738224fd3ffc1ef5323f5d23b5fc4b4aa..e2a2ed8ad307eb1d78ca956c225ed582bd62f68a 100644 (file)
@@ -248,14 +248,6 @@ static char *config_GetAppDir (const char *xdg_name, const char *xdg_default)
     return psz_dir;
 }
 
-/**
- * Get the user's VLC configuration directory
- */
-char *config_GetUserConfDir( void )
-{
-    return config_GetAppDir ("CONFIG", ".config");
-}
-
 /**
  * Get the user's VLC data directory
  * (used for stuff like the skins, custom lua modules, ...)
@@ -286,7 +278,12 @@ char *config_GetCacheDir( void )
 
 char *config_GetUserDir (vlc_userdir_t type)
 {
-    char *home = config_GetHomeDir ();
-    (void)type;
-    return home;
+    switch (type)
+    {
+        case VLC_HOME_DIR:
+            return config_GetHomeDir ();
+        case VLC_CONFIG_DIR:
+            return config_GetAppDir ("CONFIG", ".config");
+    }
+    assert (0);
 }
index e1162bdec244c005e47ab86e73432515b84f753a..84ebec6abcdb33d39f5f1d0b55742e4698a1be34 100644 (file)
@@ -59,7 +59,7 @@ static char *config_GetConfigFile( vlc_object_t *obj )
     char *psz_file = config_GetPsz( obj, "config" );
     if( psz_file == NULL )
     {
-        char *psz_dir = config_GetUserConfDir();
+        char *psz_dir = config_GetUserDir( VLC_CONFIG_DIR );
 
         if( asprintf( &psz_file, "%s" DIR_SEP CONFIG_FILE, psz_dir ) == -1 )
             psz_file = NULL;
@@ -385,8 +385,8 @@ config_Write (FILE *file, const char *desc, const char *type,
 
 static int config_PrepareDir (vlc_object_t *obj)
 {
-    char *psz_configdir = config_GetUserConfDir ();
-    if (psz_configdir == NULL) /* XXX: This should never happen */
+    char *psz_configdir = config_GetUserDir (VLC_CONFIG_DIR);
+    if (psz_configdir == NULL)
         return -1;
 
     int ret = config_CreateDir (obj, psz_configdir);
index 4f567a9525af01f3d1172bf4ddf0937c61b3c7ac..4680bac348346cf03746d1b78cd00f679f9bce44 100644 (file)
@@ -58,7 +58,6 @@ config_GetUserDir
 __config_GetInt
 __config_GetPsz
 __config_GetType
-config_GetUserConfDir
 config_GetUserDataDir
 __config_PutFloat
 __config_PutInt