Changeset 10417 for trunk/libtransmission/platform.c
- Timestamp:
- Mar 24, 2010, 11:41:08 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/platform.c
r10396 r10417 545 545 { 546 546 547 #ifdef SYS_DARWIN /* on Mac, look in the app package first, then the Application Support folder (for daemon, etc) */ 548 549 CFURLRef appURL = CFBundleCopyBundleURL( CFBundleGetMainBundle( ) ); 550 CFStringRef appRef = CFURLCopyFileSystemPath( appURL, 551 kCFURLPOSIXPathStyle ); 552 const char * appString = CFStringGetCStringPtr( appRef, 553 CFStringGetFastestEncoding( appRef ) ); 554 CFRelease( appURL ); 555 CFRelease( appRef ); 556 557 s = tr_buildPath( appString, "Contents", "Resources", "web", NULL ); 547 #ifdef SYS_DARWIN /* on Mac, look in the Application Support folder first, then in the app bundle. */ 548 549 /* Look in the Application Support folder */ 550 s = tr_buildPath( tr_sessionGetConfigDir( session ), "web", NULL ); 558 551 559 552 if( !isWebClientDir( s ) ) { 560 553 tr_free( s ); 561 554 562 /* Fallback to the Application Support folder */ 563 s = tr_buildPath( tr_sessionGetConfigDir( session ), "web", NULL ); 555 CFURLRef appURL = CFBundleCopyBundleURL( CFBundleGetMainBundle( ) ); 556 CFStringRef appRef = CFURLCopyFileSystemPath( appURL, 557 kCFURLPOSIXPathStyle ); 558 CFIndex appLength = CFStringGetMaximumSizeForEncoding( CFStringGetLength(appRef), 559 CFStringGetFastestEncoding( appRef )); 560 561 char * appString = tr_malloc( appLength + 1 ); 562 tr_bool success = CFStringGetCString( appRef, 563 appString, 564 appLength + 1, 565 CFStringGetFastestEncoding( appRef )); 566 assert( success ); 567 568 CFRelease( appURL ); 569 CFRelease( appRef ); 570 571 /* Fallback to the app bundle */ 572 s = tr_buildPath( appString, "Contents", "Resources", "web", NULL ); 564 573 if( !isWebClientDir( s ) ) { 565 574 tr_free( s ); 566 575 s = NULL; 567 576 } 577 578 tr_free( appString ); 568 579 } 569 580
Note: See TracChangeset
for help on using the changeset viewer.