From 2b10655f0ec17bdf3e151ed78871f54213e79538 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Mon, 24 Dec 2007 15:29:29 +0000 Subject: [PATCH] use tr_initFull --- macosx/Controller.m | 15 ++++++++++++--- macosx/PrefsController.m | 12 ------------ 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/macosx/Controller.m b/macosx/Controller.m index 6a5e39947..4d1558b84 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -192,15 +192,24 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi { if ((self = [super init])) { - fLib = tr_init("macosx"); + fDefaults = [NSUserDefaults standardUserDefaults]; + + fLib = tr_initFull("macosx", + [fDefaults boolForKey: @"PEXGlobal"], + [fDefaults boolForKey: @"NatTraversal"], + [fDefaults integerForKey: @"BindPort"], + TR_ENCRYPTION_PREFERRED, /* reset in prefs */ + FALSE, /* reset in prefs */ + -1, /* reset in prefs */ + FALSE, /* reset in prefs */ + -1, /* reset in prefs */ + [fDefaults integerForKey: @"PeersGlobal"]); [NSApp setDelegate: self]; fTorrents = [[NSMutableArray alloc] init]; fDisplayedTorrents = [[NSMutableArray alloc] init]; - fDefaults = [NSUserDefaults standardUserDefaults]; - fMessageController = [[MessageWindowController alloc] init]; fInfoController = [[InfoWindowController alloc] init]; fPrefsController = [[PrefsController alloc] initWithHandle: fLib]; diff --git a/macosx/PrefsController.m b/macosx/PrefsController.m index 45f46c4f5..d66ecde34 100644 --- a/macosx/PrefsController.m +++ b/macosx/PrefsController.m @@ -72,18 +72,6 @@ if ([fDefaults boolForKey: @"AutoImport"] && (autoPath = [fDefaults stringForKey: @"AutoImportDirectory"])) [[UKKQueue sharedFileWatcher] addPath: [autoPath stringByExpandingTildeInPath]]; - //set bind port - tr_setBindPort(fHandle, [fDefaults integerForKey: @"BindPort"]); - - //set NAT - tr_natTraversalEnable(fHandle, [fDefaults boolForKey: @"NatTraversal"]); - - //set peer connection values - tr_setGlobalPeerLimit(fHandle, [fDefaults integerForKey: @"PeersGlobal"]); - - //set pex - [self setPEX: nil]; - //set encryption [self setEncryptionMode: nil];