From f0b08137eda8a72f864ec41998947db9f6519e23 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Fri, 29 Jan 2010 00:50:55 +0000 Subject: [PATCH] avoid setting the port twice when setting a random port --- macosx/PrefsController.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/macosx/PrefsController.m b/macosx/PrefsController.m index e08cc9a7d..f833a2a7a 100644 --- a/macosx/PrefsController.m +++ b/macosx/PrefsController.m @@ -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