mirror of
https://github.com/transmission/transmission
synced 2025-03-10 14:13:23 +00:00
use tr_initFull
This commit is contained in:
parent
35adeec1d0
commit
2b10655f0e
2 changed files with 12 additions and 15 deletions
|
@ -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];
|
||||
|
|
|
@ -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];
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue