#1710 the daemon will use the Application Support folder on Mac

This commit is contained in:
Mitchell Livingston 2009-02-28 21:45:16 +00:00
parent 8b722071fd
commit fb02e9d437
1 changed files with 13 additions and 2 deletions

View File

@ -488,7 +488,7 @@ tr_getClutchDir( const tr_session * session UNUSED )
else
{
#ifdef SYS_DARWIN
#ifdef SYS_DARWIN /* on Mac, look in the app package first, before default unix directories */
CFURLRef appURL = CFBundleCopyBundleURL( CFBundleGetMainBundle( ) );
CFStringRef appRef = CFURLCopyFileSystemPath( appURL,
@ -499,6 +499,17 @@ tr_getClutchDir( const tr_session * session UNUSED )
CFRelease( appRef );
s = tr_buildPath( appString, "Contents", "Resources", "web", NULL );
if( !isClutchDir( s ) ) {
tr_free( s );
/* Fallback to the Application Support folder */
s = tr_buildPath( tr_sessionGetConfigDir( session ), "web", NULL );
if( !isClutchDir( s ) ) {
tr_free( s );
s = NULL;
}
}
#elif defined( WIN32 )
@ -538,7 +549,7 @@ tr_getClutchDir( const tr_session * session UNUSED )
}
}
#else /* everyone else, follow the XDG spec */
#else /* follow the XDG spec */
tr_list *candidates = NULL, *l;
const char * tmp;