]> git.sesse.net Git - vlc/commitdiff
config: Change the caching directories of VLC Mac OS X to Library/Caches/VLC
authorDerk-Jan Hartman <hartman@videolan.org>
Thu, 25 Jun 2009 13:55:22 +0000 (15:55 +0200)
committerDerk-Jan Hartman <hartman@videolan.org>
Thu, 25 Jun 2009 14:17:01 +0000 (16:17 +0200)
src/config/configuration.h
src/config/dirs.c

index 44884c986e02915eb6cf1b863ff5f036bca836a8..e078443a1eb7cf0df4d6b5a2bd274497639c5ca3 100644 (file)
@@ -59,6 +59,7 @@ int ConfigStringToKey( const char * );
 #  define CONFIG_DIR                    "config/settings/VideoLAN Client"
 #elif defined (__APPLE__)
 #  define CONFIG_DIR                    "Library/Preferences/VLC"
+#  define CACHES_DIR                    "Library/Caches/VLC"
 #elif defined( WIN32 ) || defined( UNDER_CE )
 #  define CONFIG_DIR                    "vlc"
 #else
@@ -66,6 +67,8 @@ int ConfigStringToKey( const char * );
 #endif
 #define CONFIG_FILE                     "vlcrc"
 
+
+
 # ifdef __cplusplus
 }
 # endif
index deb789ecee10a7faea920a2b1f0fa673736cb695..a241ff57becb929f02709d3190d587d339ab708c 100644 (file)
@@ -54,6 +54,7 @@
 # define DIR_SHARE "share"
 #endif
 
+
 /**
  * config_GetDataDir: find directory where shared data is installed
  *
@@ -232,5 +233,15 @@ char *config_GetUserDataDir( void )
  */
 char *config_GetCacheDir( void )
 {
+#if defined(__APPLE__)
+    char *psz_dir;
+    const char *psz_parent = GetDir (true, false);
+
+    if( asprintf( &psz_dir, "%s" DIR_SEP CACHES_DIR, psz_parent ) == -1 )
+        psz_dir = NULL;
+
+    return psz_dir;
+#else
     return config_GetFooDir ("CACHE", ".cache");
+#endif
 }