From 5b2f63e78184d104eea7b12f1ddd7ed7d944ffd5 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sun, 7 Sep 2008 16:08:29 +0000 Subject: [PATCH] trivial changes --- macosx/AboutWindowController.m | 2 +- macosx/Badger.h | 4 ++-- macosx/BlocklistDownloaderViewController.m | 2 +- macosx/PortChecker.h | 5 ++--- macosx/PortChecker.m | 20 +++++++++++--------- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/macosx/AboutWindowController.m b/macosx/AboutWindowController.m index 58665f40c..95f659511 100644 --- a/macosx/AboutWindowController.m +++ b/macosx/AboutWindowController.m @@ -47,7 +47,7 @@ AboutWindowController * fAboutBoxInstance = nil; [[NSBundle mainBundle] pathForResource: @"Credits" ofType: @"rtf"] documentAttributes: nil] autorelease]]; //size license button - float oldButtonWidth = [fLicenseButton frame].size.width; + CGFloat oldButtonWidth = [fLicenseButton frame].size.width; [fLicenseButton setTitle: NSLocalizedString(@"License", "About window -> license button")]; [fLicenseButton sizeToFit]; diff --git a/macosx/Badger.h b/macosx/Badger.h index 1a854fc1f..e87d332a1 100644 --- a/macosx/Badger.h +++ b/macosx/Badger.h @@ -29,12 +29,12 @@ { tr_handle * fLib; - int fCompleted; + NSInteger fCompleted; //tiger-only fields NSImage * fDockIcon, * fBadge; NSDictionary * fAttributes; - int fCompletedBadged; + NSInteger fCompletedBadged; BOOL fSpeedBadge, fQuittingTiger; } diff --git a/macosx/BlocklistDownloaderViewController.m b/macosx/BlocklistDownloaderViewController.m index 2a0932bf4..6b8e91be4 100644 --- a/macosx/BlocklistDownloaderViewController.m +++ b/macosx/BlocklistDownloaderViewController.m @@ -47,7 +47,7 @@ { [fButton setTitle: NSLocalizedString(@"Cancel", "Blocklist -> cancel button")]; - float oldWidth = [fButton frame].size.width; + CGFloat oldWidth = [fButton frame].size.width; [fButton sizeToFit]; NSRect buttonFrame = [fButton frame]; buttonFrame.size.width += 12.0; //sizeToFit sizes a bit too small diff --git a/macosx/PortChecker.h b/macosx/PortChecker.h index 48ad443d9..c7c619af4 100644 --- a/macosx/PortChecker.h +++ b/macosx/PortChecker.h @@ -36,7 +36,7 @@ typedef enum { id fDelegate; port_status_t fStatus; - int fPortNumber; + NSInteger fPortNumber; NSURLConnection * fConnection; NSMutableData * fPortProbeData; @@ -44,10 +44,9 @@ typedef enum NSTimer * fTimer; } -- (id) initForPort: (int) portNumber delay: (BOOL) delay withDelegate: (id) delegate; +- (id) initForPort: (NSInteger) portNumber delay: (BOOL) delay withDelegate: (id) delegate; - (void) cancelProbe; -- (void) callBackWithStatus: (port_status_t) status; - (port_status_t) status; @end diff --git a/macosx/PortChecker.m b/macosx/PortChecker.m index b26a0a72c..bd38b250d 100644 --- a/macosx/PortChecker.m +++ b/macosx/PortChecker.m @@ -32,11 +32,13 @@ - (void) startProbe; +- (void) callBackWithStatus: (port_status_t) status; + @end @implementation PortChecker -- (id) initForPort: (int) portNumber delay: (BOOL) delay withDelegate: (id) delegate +- (id) initForPort: (NSInteger) portNumber delay: (BOOL) delay withDelegate: (id) delegate { if ((self = [super init])) { @@ -77,14 +79,6 @@ [fConnection cancel]; } -- (void) callBackWithStatus: (port_status_t) status -{ - fStatus = status; - - if (fDelegate && [fDelegate respondsToSelector: @selector(portCheckerDidFinishProbing:)]) - [fDelegate performSelectorOnMainThread: @selector(portCheckerDidFinishProbing:) withObject: self waitUntilDone: NO]; -} - - (void) connection: (NSURLConnection *) connection didReceiveResponse: (NSURLResponse *) response { [fPortProbeData setLength: 0]; @@ -149,5 +143,13 @@ } } +- (void) callBackWithStatus: (port_status_t) status +{ + fStatus = status; + + if (fDelegate && [fDelegate respondsToSelector: @selector(portCheckerDidFinishProbing:)]) + [fDelegate performSelectorOnMainThread: @selector(portCheckerDidFinishProbing:) withObject: self waitUntilDone: NO]; +} + @end