]> git.sesse.net Git - vlc/blobdiff - src/config/dirs.c
Remove config_GetUserConfDir
[vlc] / src / config / dirs.c
index a6314baa90ee6a683f8e0509e89a44dd0cce5275..e2a2ed8ad307eb1d78ca956c225ed582bd62f68a 100644 (file)
@@ -215,14 +215,7 @@ static char *config_GetHomeDir (void)
 #endif
 }
 
-char *config_GetUserDir (vlc_userdir_t type)
-{
-    char *home = config_GetHomeDir ();
-    (void)type;
-    return home;
-}
-
-static char *config_GetFooDir (const char *xdg_name, const char *xdg_default)
+static char *config_GetAppDir (const char *xdg_name, const char *xdg_default)
 {
     char *psz_dir;
 #if defined(WIN32) || defined(__APPLE__) || defined(SYS_BEOS)
@@ -246,7 +239,7 @@ static char *config_GetFooDir (const char *xdg_name, const char *xdg_default)
         return psz_dir;
     }
 
-    psz_home = config_GetUserDir (VLC_HOME_DIR);
+    psz_home = config_GetHomeDir ();
     if( psz_home == NULL
      || asprintf( &psz_dir, "%s/%s/vlc", psz_home, xdg_default ) == -1 )
         psz_dir = NULL;
@@ -255,21 +248,13 @@ static char *config_GetFooDir (const char *xdg_name, const char *xdg_default)
     return psz_dir;
 }
 
-/**
- * Get the user's VLC configuration directory
- */
-char *config_GetUserConfDir( void )
-{
-    return config_GetFooDir ("CONFIG", ".config");
-}
-
 /**
  * Get the user's VLC data directory
  * (used for stuff like the skins, custom lua modules, ...)
  */
 char *config_GetUserDataDir( void )
 {
-    return config_GetFooDir ("DATA", ".local/share");
+    return config_GetAppDir ("DATA", ".local/share");
 }
 
 /**
@@ -287,6 +272,18 @@ char *config_GetCacheDir( void )
 
     return psz_dir;
 #else
-    return config_GetFooDir ("CACHE", ".cache");
+    return config_GetAppDir ("CACHE", ".cache");
 #endif
 }
+
+char *config_GetUserDir (vlc_userdir_t type)
+{
+    switch (type)
+    {
+        case VLC_HOME_DIR:
+            return config_GetHomeDir ();
+        case VLC_CONFIG_DIR:
+            return config_GetAppDir ("CONFIG", ".config");
+    }
+    assert (0);
+}