From 20a8ffd9557ae5590878cd5c3bffb2d28dc59b70 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Sun, 29 Jun 2014 03:01:43 -0400 Subject: [PATCH] Prefer real constants to preprocessor defines. --- Autoupdate.m | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Autoupdate.m b/Autoupdate.m index f8ee03c1..d5cd3c10 100644 --- a/Autoupdate.m +++ b/Autoupdate.m @@ -8,8 +8,15 @@ #include -#define LONG_INSTALLATION_TIME 5 // If the Installation takes longer than this time the Application Icon is shown in the Dock so that the user has some feedback. -#define CHECK_FOR_PARENT_TO_QUIT_TIME .5 // Time this app uses to recheck if the parent has already died. +/*! + * If the Installation takes longer than this time the Application Icon is shown in the Dock so that the user has some feedback. + */ +static const NSTimeInterval SUInstallationTimeLimit = 5; + +/*! + * Time this app uses to recheck if the parent has already died. + */ +static const NSTimeInterval SUParentQuitCheckInterval = .5; @interface TerminationListener : NSObject { @@ -57,7 +64,7 @@ if( alreadyTerminated ) [self parentHasQuit]; else - watchdogTimer = [[NSTimer scheduledTimerWithTimeInterval:CHECK_FOR_PARENT_TO_QUIT_TIME target:self selector:@selector(watchdog:) userInfo:nil repeats:YES] retain]; + watchdogTimer = [[NSTimer scheduledTimerWithTimeInterval:SUParentQuitCheckInterval target:self selector:@selector(watchdog:) userInfo:nil repeats:YES] retain]; return self; } @@ -87,7 +94,7 @@ -(void) parentHasQuit { [watchdogTimer invalidate]; - longInstallationTimer = [[NSTimer scheduledTimerWithTimeInterval: LONG_INSTALLATION_TIME + longInstallationTimer = [[NSTimer scheduledTimerWithTimeInterval:SUInstallationTimeLimit target: self selector: @selector(showAppIconInDock:) userInfo:nil repeats:NO] retain];