From: Derk-Jan Hartman Date: Thu, 25 Jun 2009 13:55:22 +0000 (+0200) Subject: config: Change the caching directories of VLC Mac OS X to Library/Caches/VLC X-Git-Tag: 1.1.0-ff~5249 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=9e8755aeb613239e3f636067b8d23a54ce604ec0;p=vlc config: Change the caching directories of VLC Mac OS X to Library/Caches/VLC --- 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 }