]> granicus.if.org Git - transmission/commitdiff
avoid setting the port twice when setting a random port
authorMitchell Livingston <livings124@transmissionbt.com>
Fri, 29 Jan 2010 00:50:55 +0000 (00:50 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Fri, 29 Jan 2010 00:50:55 +0000 (00:50 +0000)
macosx/PrefsController.m

index e08cc9a7d6469c896b3c86353afe1ec31025c864..f833a2a7abc180b11c14135b8f4b5c53b3674666 100644 (file)
@@ -341,7 +341,7 @@ tr_session * fHandle;
 
 - (void) setPort: (id) sender
 {
-    const int port = [sender intValue];
+    const tr_port port = [sender intValue];
     [fDefaults setInteger: port forKey: @"BindPort"];
     tr_sessionSetPeerPort(fHandle, port);
     
@@ -352,9 +352,11 @@ tr_session * fHandle;
 - (void) randomPort: (id) sender
 {
     const tr_port port = tr_sessionSetPeerPortRandom(fHandle);
-    
+    [fDefaults setInteger: port forKey: @"BindPort"];
     [fPortField setIntValue: port];
-    [self setPort: fPortField];
+    
+    fPeerPort = -1;
+    [self updatePortStatus];
 }
 
 - (void) setRandomPortOnStart: (id) sender