From 9e8755aeb613239e3f636067b8d23a54ce604ec0 Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Thu, 25 Jun 2009 15:55:22 +0200 Subject: [PATCH] config: Change the caching directories of VLC Mac OS X to Library/Caches/VLC --- src/config/configuration.h | 3 +++ src/config/dirs.c | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/config/configuration.h b/src/config/configuration.h index 44884c986e..e078443a1e 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 deb789ecee..a241ff57be 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 } -- 2.39.5