]> granicus.if.org Git - transmission/commitdiff
#1710 the daemon will use the Application Support folder on Mac
authorMitchell Livingston <livings124@transmissionbt.com>
Sat, 28 Feb 2009 21:45:16 +0000 (21:45 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Sat, 28 Feb 2009 21:45:16 +0000 (21:45 +0000)
libtransmission/platform.c

index b2412613d57ff30535f4cbf6c6554e169649b07a..6d60248360fa5b6535eddfe720fc636f6d9dbc8c 100644 (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;