Skip to content

Commit

Permalink
fixed warning by moving private methods higher in the source file
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean McBride authored and Sean McBride committed Dec 30, 2009
1 parent d7774c0 commit d726066
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 37 deletions.
10 changes: 5 additions & 5 deletions SUDiskImageUnarchiver.m
Expand Up @@ -18,11 +18,6 @@ + (BOOL)_canUnarchivePath:(NSString *)path
return [[path pathExtension] isEqualToString:@"dmg"];
}

- (void)start
{
[NSThread detachNewThreadSelector:@selector(_extractDMG) toTarget:self withObject:nil];
}

- (void)_extractDMG
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
Expand Down Expand Up @@ -77,6 +72,11 @@ - (void)_extractDMG
[pool drain];
}

- (void)start
{
[NSThread detachNewThreadSelector:@selector(_extractDMG) toTarget:self withObject:nil];
}

+ (void)load
{
[self _registerImplementation:self];
Expand Down
18 changes: 9 additions & 9 deletions SUUIBasedUpdateDriver.m
Expand Up @@ -14,6 +14,13 @@

@implementation SUUIBasedUpdateDriver

- (IBAction)cancelDownload:sender
{
if (download)
[download cancel];
[self abortUpdate];
}

- (void)didFindValidUpdate
{
updateAlert = [[SUUpdateAlert alloc] initWithAppcastItem:updateItem host:host];
Expand Down Expand Up @@ -103,13 +110,6 @@ - (void)download:(NSURLDownload *)download didReceiveDataOfLength:(NSUInteger)le
[statusController setStatusText:[NSString stringWithFormat:SULocalizedString(@"%@ downloaded", nil), [self _humanReadableSizeFromDouble:[statusController progressValue]]]];
}

- (IBAction)cancelDownload:sender
{
if (download)
[download cancel];
[self abortUpdate];
}

- (void)extractUpdate
{
// Now we have to extract the downloaded archive.
Expand All @@ -134,6 +134,8 @@ - (void)unarchiver:(SUUnarchiver *)ua extractedLength:(unsigned long)length
[statusController setProgressValue:[statusController progressValue] + (double)length];
}

- (void)installAndRestart:sender { [self installUpdate]; }

- (void)unarchiverDidFinish:(SUUnarchiver *)ua
{
[statusController beginActionWithTitle:SULocalizedString(@"Ready to Install", nil) maxProgressValue:1.0 statusText:nil];
Expand All @@ -143,8 +145,6 @@ - (void)unarchiverDidFinish:(SUUnarchiver *)ua
[NSApp requestUserAttention:NSInformationalRequest];
}

- (void)installAndRestart:sender { [self installUpdate]; }

- (void)installUpdate
{
[statusController beginActionWithTitle:SULocalizedString(@"Installing update...", @"Take care not to overflow the status window.") maxProgressValue:0.0 statusText:nil];
Expand Down
32 changes: 16 additions & 16 deletions SUUserInitiatedUpdateDriver.m
Expand Up @@ -13,6 +13,22 @@

@implementation SUUserInitiatedUpdateDriver

- (void)closeCheckingWindow
{
if (checkingController)
{
[[checkingController window] close];
[checkingController release];
checkingController = nil;
}
}

- (void)cancelCheckForUpdates:sender
{
[self closeCheckingWindow];
isCanceled = YES;
}

- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)aHost
{
checkingController = [[SUStatusController alloc] initWithHost:aHost];
Expand All @@ -30,22 +46,6 @@ - (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)aHost
}
}

- (void)closeCheckingWindow
{
if (checkingController)
{
[[checkingController window] close];
[checkingController release];
checkingController = nil;
}
}

- (void)cancelCheckForUpdates:sender
{
[self closeCheckingWindow];
isCanceled = YES;
}

- (void)appcastDidFinishLoading:(SUAppcast *)ac
{
if (isCanceled)
Expand Down
14 changes: 7 additions & 7 deletions relaunch.m
Expand Up @@ -16,6 +16,13 @@ - (void)relaunch __dead2;

@implementation TerminationListener

- (void)watchdog:(NSTimer *)timer
{
ProcessSerialNumber psn;
if (GetProcessForPID(parentProcessId, &psn) == procNotFound)
[self relaunch];
}

- (id) initWithExecutablePath:(const char *)execPath parentProcessId:(pid_t)ppid
{
self = [super init];
Expand All @@ -30,13 +37,6 @@ - (id) initWithExecutablePath:(const char *)execPath parentProcessId:(pid_t)ppid
return self;
}

- (void)watchdog:(NSTimer *)timer
{
ProcessSerialNumber psn;
if (GetProcessForPID(parentProcessId, &psn) == procNotFound)
[self relaunch];
}

- (void) relaunch
{
[[NSWorkspace sharedWorkspace] openFile:[[NSFileManager defaultManager] stringWithFileSystemRepresentation:executablePath length:strlen(executablePath)]];
Expand Down

0 comments on commit d726066

Please sign in to comment.