From 5ee02e954e46b488888492d5d6a4ed3011269a2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Tue, 20 Dec 2016 23:40:30 +0100 Subject: [PATCH] Renamed callbacks --- Sparkle/SUBasicUpdateDriver.m | 4 ++-- Sparkle/SUBinaryDeltaUnarchiver.m | 2 +- Sparkle/SUDiskImageUnarchiver.m | 2 +- Sparkle/SUPipedUnarchiver.m | 2 +- Sparkle/SUUnarchiver.m | 4 ++-- Sparkle/SUUnarchiver_Private.h | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Sparkle/SUBasicUpdateDriver.m b/Sparkle/SUBasicUpdateDriver.m index 0c714d03..3735b6ba 100644 --- a/Sparkle/SUBasicUpdateDriver.m +++ b/Sparkle/SUBasicUpdateDriver.m @@ -356,7 +356,7 @@ [self installWithToolAndRelaunch:YES]; } -- (void)unarchiverDidFail:(SUUnarchiver *)__unused ua +- (void)unarchiverDidFail:(NSError *)err { // No longer needed self.updateValidator = nil; @@ -366,7 +366,7 @@ return; } - [self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey: SULocalizedString(@"An error occurred while extracting the archive. Please try again later.", nil) }]]; + [self abortUpdateWithError:err]; } - (void)installWithToolAndRelaunch:(BOOL)relaunch diff --git a/Sparkle/SUBinaryDeltaUnarchiver.m b/Sparkle/SUBinaryDeltaUnarchiver.m index 04aba6ff..046dd0db 100644 --- a/Sparkle/SUBinaryDeltaUnarchiver.m +++ b/Sparkle/SUBinaryDeltaUnarchiver.m @@ -71,7 +71,7 @@ BOOL success = applyBinaryDelta(sourcePath, targetPath, self.archivePath, NO, &applyDiffError); if (success) { [[self class] updateSpotlightImportersAtBundlePath:targetPath]; - [self notifyDelegateOfSuccess]; + [self unarchiverDidFinish]; } else { [self unarchiverDidFailWithError:applyDiffError]; diff --git a/Sparkle/SUDiskImageUnarchiver.m b/Sparkle/SUDiskImageUnarchiver.m index 40b69fce..06cba163 100644 --- a/Sparkle/SUDiskImageUnarchiver.m +++ b/Sparkle/SUDiskImageUnarchiver.m @@ -139,7 +139,7 @@ } } - [self notifyDelegateOfSuccess]; + [self unarchiverDidFinish]; goto finally; reportError: diff --git a/Sparkle/SUPipedUnarchiver.m b/Sparkle/SUPipedUnarchiver.m index 6b7373e9..8b34d666 100644 --- a/Sparkle/SUPipedUnarchiver.m +++ b/Sparkle/SUPipedUnarchiver.m @@ -104,7 +104,7 @@ if ([task terminationStatus] == 0) { if (bytesRead == expectedLength) { - [self notifyDelegateOfSuccess]; + [self unarchiverDidFinish]; return; } else { error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Extraction failed, command '%@' got only %ld of %ld bytes", command, (long)bytesRead, (long)expectedLength]}]; diff --git a/Sparkle/SUUnarchiver.m b/Sparkle/SUUnarchiver.m index 1b8d292a..9b309a70 100644 --- a/Sparkle/SUUnarchiver.m +++ b/Sparkle/SUUnarchiver.m @@ -67,7 +67,7 @@ } } -- (void)notifyDelegateOfSuccess +- (void)unarchiverDidFinish { dispatch_async(dispatch_get_main_queue(), ^{ if ([self.delegate respondsToSelector:@selector(unarchiverDidFinish:)]) { @@ -76,7 +76,7 @@ }); } -- (void)unarchiverDidFailWithError:(NSError *)error +- (void)unarchiverDidFail:(NSError *)reason { dispatch_async(dispatch_get_main_queue(), ^{ if ([self.delegate respondsToSelector:@selector(unarchiverDidFail:)]) { diff --git a/Sparkle/SUUnarchiver_Private.h b/Sparkle/SUUnarchiver_Private.h index f8853d1f..c7718e9f 100644 --- a/Sparkle/SUUnarchiver_Private.h +++ b/Sparkle/SUUnarchiver_Private.h @@ -19,8 +19,8 @@ - (instancetype)initWithPath:(NSString *)archive hostBundlePath:(NSString *)host; - (void)notifyDelegateOfProgress:(double)progress; -- (void)notifyDelegateOfSuccess; -- (void)unarchiverDidFailWithError:(NSError *)error; +- (void)unarchiverDidFinish; +- (void)unarchiverDidFailWithError:(NSError *)err; @end #endif