From d37b29264d961733f316226126cd2d41a199f3f6 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sun, 22 Jan 2012 17:57:55 +0000 Subject: [PATCH] use NSSearchPathForDirectoriesInDomains to retrieve the Application Support directory for config files, instead of libtransmission's hardcoded path --- macosx/Controller.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/macosx/Controller.m b/macosx/Controller.m index ea503cfac..4cb4c27e7 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -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);