1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 08:43:27 +00:00

use NSSearchPathForDirectoriesInDomains to retrieve the Application Support directory for config files, instead of libtransmission's hardcoded path

This commit is contained in:
Mitchell Livingston 2012-01-22 17:57:55 +00:00
parent 4a64ae9fa2
commit d37b29264d

View file

@ -320,7 +320,8 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
[NSLocalizedString(@"GB", "Memory size - gigabytes") UTF8String],
[NSLocalizedString(@"TB", "Memory size - terabytes") UTF8String]);
const char * configDir = tr_getDefaultConfigDir("Transmission");
//use this instead of tr_getDefaultConfigDir("Transmission") so we are sure to get the "real" Application Support directory
const char * configDir = [[[NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) objectAtIndex: 0] stringByAppendingPathComponent: @"Transmission"] UTF8String];
fLib = tr_sessionInit("macosx", configDir, YES, &settings);
tr_bencFree(&settings);