[vlc-devel] commit: config: Change the caching directories of VLC Mac OS X to Library/ Caches/VLC (Derk-Jan Hartman )

git version control git at videolan.org
Thu Jun 25 16:17:10 CEST 2009


vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Thu Jun 25 15:55:22 2009 +0200| [9e8755aeb613239e3f636067b8d23a54ce604ec0] | committer: Derk-Jan Hartman 

config: Change the caching directories of VLC Mac OS X to Library/Caches/VLC

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9e8755aeb613239e3f636067b8d23a54ce604ec0
---

 src/config/configuration.h |    3 +++
 src/config/dirs.c          |   11 +++++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/config/configuration.h b/src/config/configuration.h
index 44884c9..e078443 100644
--- a/src/config/configuration.h
+++ b/src/config/configuration.h
@@ -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
diff --git a/src/config/dirs.c b/src/config/dirs.c
index deb789e..a241ff5 100644
--- a/src/config/dirs.c
+++ b/src/config/dirs.c
@@ -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
 }




More information about the vlc-devel mailing list