mirror of
https://github.com/transmission/transmission
synced 2024-12-24 16:52:39 +00:00
use NSSearchPathForDirectoriesInDomains to retrieve the Application Support directory for config files, instead of libtransmission's hardcoded path
This commit is contained in:
parent
4a64ae9fa2
commit
d37b29264d
1 changed files with 2 additions and 1 deletions
|
@ -320,7 +320,8 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
|
||||||
[NSLocalizedString(@"GB", "Memory size - gigabytes") UTF8String],
|
[NSLocalizedString(@"GB", "Memory size - gigabytes") UTF8String],
|
||||||
[NSLocalizedString(@"TB", "Memory size - terabytes") 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);
|
fLib = tr_sessionInit("macosx", configDir, YES, &settings);
|
||||||
tr_bencFree(&settings);
|
tr_bencFree(&settings);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue