From 49c10c8cb50d83dca7fb45b47027aed14086e472 Mon Sep 17 00:00:00 2001 From: Zorg Date: Tue, 1 Mar 2016 00:16:59 -0500 Subject: [PATCH] Move Sparkle's user updater driver delegate protocol out of SUUserUpdaterDriver --- Sparkle.xcodeproj/project.pbxproj | 4 ---- Sparkle/SUSparkleUserUpdaterDriver.h | 18 +++++++++++++++++- Sparkle/SUSparkleUserUpdaterDriver.m | 4 ++-- Sparkle/SUUserUpdaterDriver.h | 3 --- Sparkle/SUUserUpdaterDriverDelegate.h | 25 ------------------------- 5 files changed, 19 insertions(+), 35 deletions(-) delete mode 100644 Sparkle/SUUserUpdaterDriverDelegate.h diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index bbe876c3..01d75f84 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -181,7 +181,6 @@ 725CB95B1C7121830064365A /* SUSparkleUserUpdaterDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 725CB9591C7121830064365A /* SUSparkleUserUpdaterDriver.m */; }; 7268AC631AD634C200C3E0C1 /* SUBinaryDeltaCreate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7268AC621AD634C200C3E0C1 /* SUBinaryDeltaCreate.m */; }; 726DF88E1C84277600188804 /* SUStatusCompletionResults.h in Headers */ = {isa = PBXBuildFile; fileRef = 726DF88D1C84277500188804 /* SUStatusCompletionResults.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 726DF8901C8429E000188804 /* SUUserUpdaterDriverDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 726DF88F1C8429E000188804 /* SUUserUpdaterDriverDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 726F2CDE1BC9BE5B001971A4 /* SUFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7275F9C01B5F1F2900B1D19E /* SUFileManager.m */; }; 726F2CE51BC9C33D001971A4 /* SUOperatingSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 726F2CE31BC9C33D001971A4 /* SUOperatingSystem.h */; }; 726F2CE61BC9C33D001971A4 /* SUOperatingSystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */; }; @@ -643,7 +642,6 @@ 7268AC641AD634E400C3E0C1 /* SUBinaryDeltaCreate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUBinaryDeltaCreate.h; sourceTree = ""; }; 726B2B5D1C645FC900388755 /* UI Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "UI Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 726DF88D1C84277500188804 /* SUStatusCompletionResults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUStatusCompletionResults.h; sourceTree = ""; }; - 726DF88F1C8429E000188804 /* SUUserUpdaterDriverDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUserUpdaterDriverDelegate.h; sourceTree = ""; }; 726F2CE31BC9C33D001971A4 /* SUOperatingSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUOperatingSystem.h; sourceTree = ""; }; 726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUOperatingSystem.m; sourceTree = ""; }; 7275F9BF1B5F1F2900B1D19E /* SUFileManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUFileManager.h; sourceTree = ""; }; @@ -1096,7 +1094,6 @@ isa = PBXGroup; children = ( 725CB9561C7120410064365A /* SUUserUpdaterDriver.h */, - 726DF88F1C8429E000188804 /* SUUserUpdaterDriverDelegate.h */, 726DF88D1C84277500188804 /* SUStatusCompletionResults.h */, 61B93B250DD0FDD300DCD2F8 /* SUAutomaticUpdateDriver.h */, 61B93B260DD0FDD300DCD2F8 /* SUAutomaticUpdateDriver.m */, @@ -1180,7 +1177,6 @@ buildActionMask = 2147483647; files = ( 725CB95A1C7121830064365A /* SUSparkleUserUpdaterDriver.h in Headers */, - 726DF8901C8429E000188804 /* SUUserUpdaterDriverDelegate.h in Headers */, 725CB9571C7120410064365A /* SUUserUpdaterDriver.h in Headers */, 72162B061C82C8B30013C1C5 /* SUParameterAssert.h in Headers */, 726DF88E1C84277600188804 /* SUStatusCompletionResults.h in Headers */, diff --git a/Sparkle/SUSparkleUserUpdaterDriver.h b/Sparkle/SUSparkleUserUpdaterDriver.h index cc36dd24..6eae58c6 100644 --- a/Sparkle/SUSparkleUserUpdaterDriver.h +++ b/Sparkle/SUSparkleUserUpdaterDriver.h @@ -9,9 +9,25 @@ #import #import "SUUserUpdaterDriver.h" +@protocol SUSparkleUserUpdaterDriverDelegate + +@optional + +- (BOOL)responsibleForInitiatingUpdateCheckForUserDriver:(id )userUpdaterDriver; +- (void)initiateUpdateCheckForUserDriver:(id )userUpdaterDriver; + +- (BOOL)responsibleForSignalingApplicationTerminationForUserDriver:(id )userUpdaterDriver; + +- (void)userUpdaterDriverWillShowModalAlert:(id )userUpdaterDriver; +- (void)userUpdaterDriverDidShowModalAlert:(id )userUpdaterDriver; + +@end + @interface SUSparkleUserUpdaterDriver : NSObject -- (instancetype)initWithHostBundle:(NSBundle *)hostBundle delegate:(id )delegate; +- (instancetype)initWithHostBundle:(NSBundle *)hostBundle delegate:(id )delegate; + +@property (nonatomic, readonly, weak) id delegate; @property (nonatomic, readonly, getter=isUpdateInProgress) BOOL updateInProgress; diff --git a/Sparkle/SUSparkleUserUpdaterDriver.m b/Sparkle/SUSparkleUserUpdaterDriver.m index 1328ff9f..96bdfae7 100644 --- a/Sparkle/SUSparkleUserUpdaterDriver.m +++ b/Sparkle/SUSparkleUserUpdaterDriver.m @@ -68,7 +68,7 @@ #pragma mark Birth -- (instancetype)initWithHostBundle:(NSBundle *)hostBundle delegate:(id)delegate +- (instancetype)initWithHostBundle:(NSBundle *)hostBundle delegate:(id)delegate { self = [super init]; if (self != nil) { @@ -345,7 +345,7 @@ - (void)showAlert:(NSAlert *)alert { dispatch_async(dispatch_get_main_queue(), ^{ - id delegate = self.delegate; + id delegate = self.delegate; if ([delegate respondsToSelector:@selector(userUpdaterDriverWillShowModalAlert:)]) { [delegate userUpdaterDriverWillShowModalAlert:self]; diff --git a/Sparkle/SUUserUpdaterDriver.h b/Sparkle/SUUserUpdaterDriver.h index 1fca9b43..ba44cdb4 100644 --- a/Sparkle/SUUserUpdaterDriver.h +++ b/Sparkle/SUUserUpdaterDriver.h @@ -7,7 +7,6 @@ // #import -#import "SUUserUpdaterDriverDelegate.h" #import "SUStatusCompletionResults.h" @class SUUpdatePermissionPromptResult, SUAppcastItem; @@ -15,8 +14,6 @@ @protocol SUUserUpdaterDriver -@property (nonatomic, readonly, weak) id delegate; - - (void)showUpdateInProgress:(BOOL)isUpdateInProgress; - (void)startUpdateCheckTimerWithNextTimeInterval:(NSTimeInterval)timeInterval reply:(void (^)(SUUpdateCheckTimerStatus))reply; diff --git a/Sparkle/SUUserUpdaterDriverDelegate.h b/Sparkle/SUUserUpdaterDriverDelegate.h deleted file mode 100644 index c1d9d295..00000000 --- a/Sparkle/SUUserUpdaterDriverDelegate.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// SUUserUpdaterDriverDelegate.h -// Sparkle -// -// Created by Mayur Pawashe on 2/29/16. -// Copyright © 2016 Sparkle Project. All rights reserved. -// - -#import - -@protocol SUUserUpdaterDriver; - -@protocol SUUserUpdaterDriverDelegate - -@optional - -- (BOOL)responsibleForInitiatingUpdateCheckForUserDriver:(id )userUpdaterDriver; -- (void)initiateUpdateCheckForUserDriver:(id )userUpdaterDriver; - -- (BOOL)responsibleForSignalingApplicationTerminationForUserDriver:(id )userUpdaterDriver; - -- (void)userUpdaterDriverWillShowModalAlert:(id )userUpdaterDriver; -- (void)userUpdaterDriverDidShowModalAlert:(id )userUpdaterDriver; - -@end