mirror of
https://github.com/transmission/transmission
synced 2025-03-10 06:02:57 +00:00
#1710 the daemon will use the Application Support folder on Mac
This commit is contained in:
parent
8b722071fd
commit
fb02e9d437
1 changed files with 13 additions and 2 deletions
|
@ -488,7 +488,7 @@ tr_getClutchDir( const tr_session * session UNUSED )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef SYS_DARWIN
|
#ifdef SYS_DARWIN /* on Mac, look in the app package first, before default unix directories */
|
||||||
|
|
||||||
CFURLRef appURL = CFBundleCopyBundleURL( CFBundleGetMainBundle( ) );
|
CFURLRef appURL = CFBundleCopyBundleURL( CFBundleGetMainBundle( ) );
|
||||||
CFStringRef appRef = CFURLCopyFileSystemPath( appURL,
|
CFStringRef appRef = CFURLCopyFileSystemPath( appURL,
|
||||||
|
@ -500,6 +500,17 @@ tr_getClutchDir( const tr_session * session UNUSED )
|
||||||
|
|
||||||
s = tr_buildPath( appString, "Contents", "Resources", "web", NULL );
|
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 )
|
#elif defined( WIN32 )
|
||||||
|
|
||||||
/* SHGetFolderPath explicitly requires MAX_PATH length */
|
/* SHGetFolderPath explicitly requires MAX_PATH length */
|
||||||
|
@ -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;
|
tr_list *candidates = NULL, *l;
|
||||||
const char * tmp;
|
const char * tmp;
|
||||||
|
|
Loading…
Add table
Reference in a new issue