From 350eba452c41f5cd2b016e60c0e5fc1f4a20a350 Mon Sep 17 00:00:00 2001 From: Zorg Date: Sun, 1 May 2016 14:54:17 -0400 Subject: [PATCH] s/SUUpdatePermissionPromptResult/SUUpdatePermission/ && s/shouldSendProfile/sendProfile/ --- Sparkle.xcodeproj/project.pbxproj | 20 +++---- Sparkle/SUStandardUserDriver.m | 2 +- ...ionPromptResult.h => SUUpdatePermission.h} | 8 +-- Sparkle/SUUpdatePermission.m | 56 +++++++++++++++++++ Sparkle/SUUpdatePermissionPrompt.h | 4 +- Sparkle/SUUpdatePermissionPrompt.m | 10 ++-- Sparkle/SUUpdatePermissionPromptResult.m | 53 ------------------ Sparkle/SUUpdater.m | 8 +-- Sparkle/SUUserDriver.h | 4 +- Sparkle/Sparkle.h | 2 +- TestApplication/SUPopUpTitlebarUserDriver.m | 4 +- Tests/SUUpdaterTest.m | 2 +- sparkle-cli/SUCommandLineDriver.h | 4 +- sparkle-cli/SUCommandLineDriver.m | 2 +- sparkle-cli/SUCommandLineUserDriver.h | 2 +- sparkle-cli/SUCommandLineUserDriver.m | 8 +-- sparkle-cli/main.m | 4 +- 17 files changed, 98 insertions(+), 95 deletions(-) rename Sparkle/{SUUpdatePermissionPromptResult.h => SUUpdatePermission.h} (54%) create mode 100644 Sparkle/SUUpdatePermission.m delete mode 100644 Sparkle/SUUpdatePermissionPromptResult.m diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index 5df9f5a0..4160a533 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -87,7 +87,6 @@ 61299A6009CA6EB100B7442F /* SUConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A5F09CA6EB100B7442F /* SUConstants.m */; }; 61299A8D09CA790200B7442F /* SUUnarchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299A8B09CA790200B7442F /* SUUnarchiver.h */; }; 61299B3609CB04E000B7442F /* Sparkle.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299B3509CB04E000B7442F /* Sparkle.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 612DCBAF0D488BC60015DBEA /* SUUpdatePermissionPrompt.h in Headers */ = {isa = PBXBuildFile; fileRef = 612DCBAD0D488BC60015DBEA /* SUUpdatePermissionPrompt.h */; settings = {ATTRIBUTES = (); }; }; 612DCBB00D488BC60015DBEA /* SUUpdatePermissionPrompt.m in Sources */ = {isa = PBXBuildFile; fileRef = 612DCBAE0D488BC60015DBEA /* SUUpdatePermissionPrompt.m */; }; 615AE3D00D64DC40001CA7BD /* SUModelTranslation.plist in Resources */ = {isa = PBXBuildFile; fileRef = 615AE3CF0D64DC40001CA7BD /* SUModelTranslation.plist */; }; 618FA5010DAE88B40026945C /* SUInstaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 618FA4FF0DAE88B40026945C /* SUInstaller.h */; settings = {ATTRIBUTES = (); }; }; @@ -224,8 +223,9 @@ 729746571C936D5E00FC134E /* SUMessageTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 729746551C936D5E00FC134E /* SUMessageTypes.h */; }; 729746581C936D5E00FC134E /* SUMessageTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 729746561C936D5E00FC134E /* SUMessageTypes.m */; }; 729746591C936D5E00FC134E /* SUMessageTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 729746561C936D5E00FC134E /* SUMessageTypes.m */; }; - 72A450531C69A68900D67EEA /* SUUpdatePermissionPromptResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 72A450511C69A68900D67EEA /* SUUpdatePermissionPromptResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 72A450541C69A68900D67EEA /* SUUpdatePermissionPromptResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 72A450521C69A68900D67EEA /* SUUpdatePermissionPromptResult.m */; }; + 72A1C2631CD6849C004CD282 /* SUUpdatePermissionPrompt.h in Headers */ = {isa = PBXBuildFile; fileRef = 612DCBAD0D488BC60015DBEA /* SUUpdatePermissionPrompt.h */; }; + 72A450531C69A68900D67EEA /* SUUpdatePermission.h in Headers */ = {isa = PBXBuildFile; fileRef = 72A450511C69A68900D67EEA /* SUUpdatePermission.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 72A450541C69A68900D67EEA /* SUUpdatePermission.m in Sources */ = {isa = PBXBuildFile; fileRef = 72A450521C69A68900D67EEA /* SUUpdatePermission.m */; }; 72A4A2401BB6567D00E7820D /* SUFileManagerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72A4A23F1BB6567D00E7820D /* SUFileManagerTest.swift */; }; 72A6F97E1C94C370005F404C /* SUDSAVerifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A2E09CA2DAB00B7442F /* SUDSAVerifier.m */; }; 72A6F97F1C94C392005F404C /* SUUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A8C09CA790200B7442F /* SUUnarchiver.m */; }; @@ -862,8 +862,8 @@ 729746561C936D5E00FC134E /* SUMessageTypes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUMessageTypes.m; sourceTree = ""; }; 729F10FD1C65A9B500DFCCC5 /* ConfigUITest.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigUITest.xcconfig; sourceTree = ""; }; 729F10FE1C65A9B500DFCCC5 /* ConfigUITestCoverage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigUITestCoverage.xcconfig; sourceTree = ""; }; - 72A450511C69A68900D67EEA /* SUUpdatePermissionPromptResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdatePermissionPromptResult.h; sourceTree = ""; }; - 72A450521C69A68900D67EEA /* SUUpdatePermissionPromptResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUpdatePermissionPromptResult.m; sourceTree = ""; }; + 72A450511C69A68900D67EEA /* SUUpdatePermission.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdatePermission.h; sourceTree = ""; }; + 72A450521C69A68900D67EEA /* SUUpdatePermission.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUpdatePermission.m; sourceTree = ""; }; 72A4A23F1BB6567D00E7820D /* SUFileManagerTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SUFileManagerTest.swift; sourceTree = ""; }; 72A6F97D1C94A5C2005F404C /* SUInstallerProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUInstallerProtocol.h; path = Autoupdate/SUInstallerProtocol.h; sourceTree = ""; }; 72A6F9891C94E2D6005F404C /* SUUpdaterDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdaterDelegate.h; sourceTree = ""; }; @@ -1373,8 +1373,6 @@ 55C14F05136EF6DB00649790 /* SULog.m */, 726F2CE31BC9C33D001971A4 /* SUOperatingSystem.h */, 726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */, - 72A450511C69A68900D67EEA /* SUUpdatePermissionPromptResult.h */, - 72A450521C69A68900D67EEA /* SUUpdatePermissionPromptResult.m */, ); includeInIndex = 1; name = "Other Sources"; @@ -1458,6 +1456,8 @@ 726E078B1CA891E9001A286B /* SUUpdaterSettings.h */, 726E078C1CA891E9001A286B /* SUUpdaterSettings.m */, 72A6F9891C94E2D6005F404C /* SUUpdaterDelegate.h */, + 72A450511C69A68900D67EEA /* SUUpdatePermission.h */, + 72A450521C69A68900D67EEA /* SUUpdatePermission.m */, ); name = "Update Control"; sourceTree = ""; @@ -1700,7 +1700,7 @@ 72162B061C82C8B30013C1C5 /* SUParameterAssert.h in Headers */, 729746571C936D5E00FC134E /* SUMessageTypes.h in Headers */, 726DF88E1C84277600188804 /* SUStatusCompletionResults.h in Headers */, - 72A450531C69A68900D67EEA /* SUUpdatePermissionPromptResult.h in Headers */, + 72A450531C69A68900D67EEA /* SUUpdatePermission.h in Headers */, 7229E1B61C97C91100CB50D0 /* SUUpdateDriver.h in Headers */, 729746401C9119F300FC134E /* SULocalMessagePort.h in Headers */, 61299B3609CB04E000B7442F /* Sparkle.h in Headers */, @@ -1708,6 +1708,7 @@ 72F94F581CC44DE1002DEE68 /* SUXPCServiceInfo.h in Headers */, 72162B081C82C9600013C1C5 /* SULocalizations.h in Headers */, 61B5FC0D09C4FC8200B25A18 /* SUAppcast.h in Headers */, + 72A1C2631CD6849C004CD282 /* SUUpdatePermissionPrompt.h in Headers */, 7246E0A31C83B685003B4E75 /* SUStandardUpdaterController.h in Headers */, 726E08011CAF3F70001A286B /* SUDownloaderDelegate.h in Headers */, 61299A8D09CA790200B7442F /* SUUnarchiver.h in Headers */, @@ -1748,7 +1749,6 @@ 7229E1BD1C98EFF200CB50D0 /* SUDownloadDriver.h in Headers */, 72B767CE1C9B924900A07552 /* SUInstallerDriver.h in Headers */, 61B5FCDF09C52A9F00B25A18 /* SUUpdateAlert.h in Headers */, - 612DCBAF0D488BC60015DBEA /* SUUpdatePermissionPrompt.h in Headers */, 61B5F8ED09C4CE3C00B25A18 /* SUUpdater.h in Headers */, 61A2259E0D1C495D00430CCD /* SUVersionComparisonProtocol.h in Headers */, 3772FEA913DE0B6B00F79537 /* SUVersionDisplayProtocol.h in Headers */, @@ -2600,7 +2600,7 @@ 725602D61C83551C00DAA70E /* SUApplicationInfo.m in Sources */, 72B767DF1C9CDB9700A07552 /* SUUserInitiatedUpdateDriver.m in Sources */, 72B767CF1C9B924900A07552 /* SUInstallerDriver.m in Sources */, - 72A450541C69A68900D67EEA /* SUUpdatePermissionPromptResult.m in Sources */, + 72A450541C69A68900D67EEA /* SUUpdatePermission.m in Sources */, 7229E1BA1C97CC4D00CB50D0 /* SUScheduledUpdateDriver.m in Sources */, 729746411C9119F300FC134E /* SULocalMessagePort.m in Sources */, 726E07611CA4E9A5001A286B /* SUInstallationInputData.m in Sources */, diff --git a/Sparkle/SUStandardUserDriver.m b/Sparkle/SUStandardUserDriver.m index fe73dc68..840a2674 100644 --- a/Sparkle/SUStandardUserDriver.m +++ b/Sparkle/SUStandardUserDriver.m @@ -102,7 +102,7 @@ #pragma mark Update Permission -- (void)requestUpdatePermissionWithSystemProfile:(NSArray *)systemProfile reply:(void (^)(SUUpdatePermissionPromptResult *))reply +- (void)requestUpdatePermissionWithSystemProfile:(NSArray *)systemProfile reply:(void (^)(SUUpdatePermission *))reply { dispatch_async(dispatch_get_main_queue(), ^{ // This shows a modal alert dialog which unlike other alerts cannot be closed until the user makes a decision diff --git a/Sparkle/SUUpdatePermissionPromptResult.h b/Sparkle/SUUpdatePermission.h similarity index 54% rename from Sparkle/SUUpdatePermissionPromptResult.h rename to Sparkle/SUUpdatePermission.h index a4e1aaef..683da36d 100644 --- a/Sparkle/SUUpdatePermissionPromptResult.h +++ b/Sparkle/SUUpdatePermission.h @@ -1,5 +1,5 @@ // -// SUUpdatePermissionPromptResult.h +// SUUpdatePermission.h // Sparkle // // Created by Mayur Pawashe on 2/8/16. @@ -14,11 +14,11 @@ typedef NS_ENUM(NSInteger, SUCheckUpdatesChoice) { SUDoNotAutomaticallyCheck }; -SU_EXPORT @interface SUUpdatePermissionPromptResult : NSObject +SU_EXPORT @interface SUUpdatePermission : NSObject -+ (instancetype)updatePermissionPromptResultWithChoice:(SUCheckUpdatesChoice)choice shouldSendProfile:(BOOL)shouldSendProfile; ++ (instancetype)updatePermissionWithChoice:(SUCheckUpdatesChoice)choice sendProfile:(BOOL)sendProfile; @property (nonatomic, readonly) SUCheckUpdatesChoice choice; -@property (nonatomic, readonly) BOOL shouldSendProfile; +@property (nonatomic, readonly) BOOL sendProfile; @end diff --git a/Sparkle/SUUpdatePermission.m b/Sparkle/SUUpdatePermission.m new file mode 100644 index 00000000..9b6e273e --- /dev/null +++ b/Sparkle/SUUpdatePermission.m @@ -0,0 +1,56 @@ +// +// SUUpdatePermission.m +// Sparkle +// +// Created by Mayur Pawashe on 2/8/16. +// Copyright © 2016 Sparkle Project. All rights reserved. +// + +#import "SUUpdatePermission.h" + +#ifdef _APPKITDEFINES_H +#error This is a "core" class and should NOT import AppKit +#endif + +static NSString *SUUpdatePermissionChoiceKey = @"SUUpdatePermissionChoice"; +static NSString *SUUpdatePermissionSendProfileKey = @"SUUpdatePermissionSendProfile"; + +@implementation SUUpdatePermission + +@synthesize choice = _choice; +@synthesize sendProfile = _sendProfile; + ++ (BOOL)supportsSecureCoding +{ + return YES; +} + +- (instancetype)initWithCoder:(NSCoder *)decoder +{ + NSInteger choice = [decoder decodeIntegerForKey:SUUpdatePermissionChoiceKey]; + BOOL sendProfile = [decoder decodeBoolForKey:SUUpdatePermissionSendProfileKey]; + return [[self class] updatePermissionWithChoice:choice sendProfile:sendProfile]; +} + +- (void)encodeWithCoder:(NSCoder *)encoder +{ + [encoder encodeInteger:self.choice forKey:SUUpdatePermissionChoiceKey]; + [encoder encodeBool:self.sendProfile forKey:SUUpdatePermissionSendProfileKey]; +} + +- (instancetype)initWithCheckUpdatesChoice:(SUCheckUpdatesChoice)choice sendProfile:(BOOL)sendProfile +{ + self = [super init]; + if (self != nil) { + _choice = choice; + _sendProfile = sendProfile; + } + return self; +} + ++ (instancetype)updatePermissionWithChoice:(SUCheckUpdatesChoice)choice sendProfile:(BOOL)sendProfile +{ + return [[self alloc] initWithCheckUpdatesChoice:choice sendProfile:sendProfile]; +} + +@end diff --git a/Sparkle/SUUpdatePermissionPrompt.h b/Sparkle/SUUpdatePermissionPrompt.h index 89c135bc..a72be144 100644 --- a/Sparkle/SUUpdatePermissionPrompt.h +++ b/Sparkle/SUUpdatePermissionPrompt.h @@ -11,11 +11,11 @@ #import -@class SUHost, SUUpdatePermissionPromptResult; +@class SUHost, SUUpdatePermission; @interface SUUpdatePermissionPrompt : NSWindowController -+ (void)promptWithHost:(SUHost *)host systemProfile:(NSArray *)systemProfile reply:(void (^)(SUUpdatePermissionPromptResult *))reply; ++ (void)promptWithHost:(SUHost *)host systemProfile:(NSArray *)systemProfile reply:(void (^)(SUUpdatePermission *))reply; - (IBAction)toggleMoreInfo:(id)sender; - (IBAction)finishPrompt:(id)sender; diff --git a/Sparkle/SUUpdatePermissionPrompt.m b/Sparkle/SUUpdatePermissionPrompt.m index 43a1de45..af1d7967 100644 --- a/Sparkle/SUUpdatePermissionPrompt.m +++ b/Sparkle/SUUpdatePermissionPrompt.m @@ -7,7 +7,7 @@ // #import "SUUpdatePermissionPrompt.h" -#import "SUUpdatePermissionPromptResult.h" +#import "SUUpdatePermission.h" #import "SULocalizations.h" #import "SUHost.h" @@ -26,7 +26,7 @@ @property (weak) IBOutlet NSButton *moreInfoButton; @property (weak) IBOutlet NSTableView *profileTableView; -@property (nonatomic, readonly) void (^reply)(SUUpdatePermissionPromptResult *); +@property (nonatomic, readonly) void (^reply)(SUUpdatePermission *); @end @@ -42,7 +42,7 @@ @synthesize moreInfoButton; @synthesize profileTableView; -- (instancetype)initPromptWithHost:(SUHost *)theHost systemProfile:(NSArray *)systemProfile reply:(void (^)(SUUpdatePermissionPromptResult *))reply +- (instancetype)initPromptWithHost:(SUHost *)theHost systemProfile:(NSArray *)systemProfile reply:(void (^)(SUUpdatePermission *))reply { self = [super initWithWindowNibName:@"SUUpdatePermissionPrompt"]; if (self) @@ -57,7 +57,7 @@ return self; } -+ (void)promptWithHost:(SUHost *)host systemProfile:(NSArray *)systemProfile reply:(void (^)(SUUpdatePermissionPromptResult *))reply ++ (void)promptWithHost:(SUHost *)host systemProfile:(NSArray *)systemProfile reply:(void (^)(SUUpdatePermission *))reply { // If this is a background application we need to focus it in order to bring the prompt // to the user's attention. Otherwise the prompt would be hidden behind other applications and @@ -153,7 +153,7 @@ - (IBAction)finishPrompt:(id)sender { - self.reply([SUUpdatePermissionPromptResult updatePermissionPromptResultWithChoice:([sender tag] == 1 ? SUAutomaticallyCheck : SUDoNotAutomaticallyCheck) shouldSendProfile:self.shouldSendProfile]); + self.reply([SUUpdatePermission updatePermissionWithChoice:([sender tag] == 1 ? SUAutomaticallyCheck : SUDoNotAutomaticallyCheck) sendProfile:self.shouldSendProfile]); [[self window] close]; [NSApp stopModal]; diff --git a/Sparkle/SUUpdatePermissionPromptResult.m b/Sparkle/SUUpdatePermissionPromptResult.m deleted file mode 100644 index 0470822e..00000000 --- a/Sparkle/SUUpdatePermissionPromptResult.m +++ /dev/null @@ -1,53 +0,0 @@ -// -// SUUpdatePermissionPromptResult.m -// Sparkle -// -// Created by Mayur Pawashe on 2/8/16. -// Copyright © 2016 Sparkle Project. All rights reserved. -// - -#import "SUUpdatePermissionPromptResult.h" - -#ifdef _APPKITDEFINES_H -#error This is a "core" class and should NOT import AppKit -#endif - -@implementation SUUpdatePermissionPromptResult - -@synthesize choice = _choice; -@synthesize shouldSendProfile = _shouldSendProfile; - -+ (BOOL)supportsSecureCoding -{ - return YES; -} - -- (instancetype)initWithCoder:(NSCoder *)decoder -{ - NSInteger choice = [decoder decodeIntegerForKey:@"choice"]; - BOOL shouldSendProfile = [decoder decodeBoolForKey:@"shouldSendProfile"]; - return [[self class] updatePermissionPromptResultWithChoice:choice shouldSendProfile:shouldSendProfile]; -} - -- (void)encodeWithCoder:(NSCoder *)encoder -{ - [encoder encodeInteger:self.choice forKey:@"choice"]; - [encoder encodeBool:self.shouldSendProfile forKey:@"shouldSendProfile"]; -} - -- (instancetype)initWithCheckUpdatesChoice:(SUCheckUpdatesChoice)choice shouldSendProfile:(BOOL)shouldSendProfile -{ - self = [super init]; - if (self != nil) { - _choice = choice; - _shouldSendProfile = shouldSendProfile; - } - return self; -} - -+ (instancetype)updatePermissionPromptResultWithChoice:(SUCheckUpdatesChoice)choice shouldSendProfile:(BOOL)shouldSendProfile -{ - return [[self alloc] initWithCheckUpdatesChoice:choice shouldSendProfile:shouldSendProfile]; -} - -@end diff --git a/Sparkle/SUUpdater.m b/Sparkle/SUUpdater.m index 9f0684e7..31e9e03b 100644 --- a/Sparkle/SUUpdater.m +++ b/Sparkle/SUUpdater.m @@ -10,7 +10,7 @@ #import "SUUpdaterDelegate.h" #import "SUUpdaterSettings.h" #import "SUHost.h" -#import "SUUpdatePermissionPromptResult.h" +#import "SUUpdatePermission.h" #import "SUUpdateDriver.h" #import "SUConstants.h" #import "SULog.h" @@ -252,7 +252,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification } __weak SUUpdater *weakSelf = self; - [self.userDriver requestUpdatePermissionWithSystemProfile:profileInfo reply:^(SUUpdatePermissionPromptResult *result) { + [self.userDriver requestUpdatePermissionWithSystemProfile:profileInfo reply:^(SUUpdatePermission *result) { dispatch_async(dispatch_get_main_queue(), ^{ SUUpdater *strongSelf = weakSelf; if (strongSelf != nil) { @@ -275,9 +275,9 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification } } -- (void)updatePermissionPromptFinishedWithResult:(SUUpdatePermissionPromptResult *)result +- (void)updatePermissionPromptFinishedWithResult:(SUUpdatePermission *)result { - [self.host setBool:result.shouldSendProfile forUserDefaultsKey:SUSendProfileInfoKey]; + [self.host setBool:result.sendProfile forUserDefaultsKey:SUSendProfileInfoKey]; [self setAutomaticallyChecksForUpdates:(result.choice == SUAutomaticallyCheck)]; } diff --git a/Sparkle/SUUserDriver.h b/Sparkle/SUUserDriver.h index 6cf06db8..1d941d8f 100644 --- a/Sparkle/SUUserDriver.h +++ b/Sparkle/SUUserDriver.h @@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN -@class SUUpdatePermissionPromptResult, SUAppcastItem; +@class SUUpdatePermission, SUAppcastItem; /*! The API in Sparkle for controlling the user interaction. @@ -85,7 +85,7 @@ NS_ASSUME_NONNULL_BEGIN * * This can be called from any thread */ -- (void)requestUpdatePermissionWithSystemProfile:(NSArray *)systemProfile reply:(void (^)(SUUpdatePermissionPromptResult *))reply; +- (void)requestUpdatePermissionWithSystemProfile:(NSArray *)systemProfile reply:(void (^)(SUUpdatePermission *))reply; /*! * Show the user initating an update check diff --git a/Sparkle/Sparkle.h b/Sparkle/Sparkle.h index 80e1173d..a7d924cf 100644 --- a/Sparkle/Sparkle.h +++ b/Sparkle/Sparkle.h @@ -22,7 +22,7 @@ #import "SUVersionComparisonProtocol.h" #import "SUVersionDisplayProtocol.h" #import "SUErrors.h" -#import "SUUpdatePermissionPromptResult.h" +#import "SUUpdatePermission.h" #import "SUUserDriver.h" #import "SUStandardUserDriver.h" #import "SUStandardUserDriverDelegate.h" diff --git a/TestApplication/SUPopUpTitlebarUserDriver.m b/TestApplication/SUPopUpTitlebarUserDriver.m index b23db539..b5947be4 100644 --- a/TestApplication/SUPopUpTitlebarUserDriver.m +++ b/TestApplication/SUPopUpTitlebarUserDriver.m @@ -150,11 +150,11 @@ #pragma mark Update Permission -- (void)requestUpdatePermissionWithSystemProfile:(NSArray *)__unused systemProfile reply:(void (^)(SUUpdatePermissionPromptResult *))reply +- (void)requestUpdatePermissionWithSystemProfile:(NSArray *)__unused systemProfile reply:(void (^)(SUUpdatePermission *))reply { // Just make a decision.. dispatch_async(dispatch_get_main_queue(), ^{ - reply([SUUpdatePermissionPromptResult updatePermissionPromptResultWithChoice:SUAutomaticallyCheck shouldSendProfile:NO]); + reply([SUUpdatePermission updatePermissionWithChoice:SUAutomaticallyCheck sendProfile:NO]); }); } diff --git a/Tests/SUUpdaterTest.m b/Tests/SUUpdaterTest.m index 011999d6..eab911d0 100644 --- a/Tests/SUUpdaterTest.m +++ b/Tests/SUUpdaterTest.m @@ -27,7 +27,7 @@ - (void)invalidateUpdateCheckTimer {} -- (void)requestUpdatePermissionWithSystemProfile:(NSArray *)__unused systemProfile reply:(void (^)(SUUpdatePermissionPromptResult *))__unused reply {} +- (void)requestUpdatePermissionWithSystemProfile:(NSArray *)__unused systemProfile reply:(void (^)(SUUpdatePermission *))__unused reply {} - (void)showUserInitiatedUpdateCheckWithCompletion:(void (^)(SUUserInitiatedCheckStatus))__unused updateCheckStatusCompletion {} diff --git a/sparkle-cli/SUCommandLineDriver.h b/sparkle-cli/SUCommandLineDriver.h index 2d51d754..ab9e04ba 100644 --- a/sparkle-cli/SUCommandLineDriver.h +++ b/sparkle-cli/SUCommandLineDriver.h @@ -10,11 +10,11 @@ NS_ASSUME_NONNULL_BEGIN -@class SUUpdatePermissionPromptResult; +@class SUUpdatePermission; @interface SUCommandLineDriver : NSObject -- (nullable instancetype)initWithUpdateBundlePath:(NSString *)updateBundlePath applicationBundlePath:(nullable NSString *)applicationBundlePath updatePermission:(nullable SUUpdatePermissionPromptResult *)updatePermission deferInstallation:(BOOL)deferInstallation verbose:(BOOL)verbose; +- (nullable instancetype)initWithUpdateBundlePath:(NSString *)updateBundlePath applicationBundlePath:(nullable NSString *)applicationBundlePath updatePermission:(nullable SUUpdatePermission *)updatePermission deferInstallation:(BOOL)deferInstallation verbose:(BOOL)verbose; - (void)runAndCheckForUpdatesNow:(BOOL)checkForUpdatesNow; diff --git a/sparkle-cli/SUCommandLineDriver.m b/sparkle-cli/SUCommandLineDriver.m index 2cff11ab..040b53a2 100644 --- a/sparkle-cli/SUCommandLineDriver.m +++ b/sparkle-cli/SUCommandLineDriver.m @@ -22,7 +22,7 @@ @synthesize updater = _updater; @synthesize applicationBundlePath = _applicationBundlePath; -- (instancetype)initWithUpdateBundlePath:(NSString *)updateBundlePath applicationBundlePath:(nullable NSString *)applicationBundlePath updatePermission:(nullable SUUpdatePermissionPromptResult *)updatePermission deferInstallation:(BOOL)deferInstallation verbose:(BOOL)verbose +- (instancetype)initWithUpdateBundlePath:(NSString *)updateBundlePath applicationBundlePath:(nullable NSString *)applicationBundlePath updatePermission:(nullable SUUpdatePermission *)updatePermission deferInstallation:(BOOL)deferInstallation verbose:(BOOL)verbose { self = [super init]; if (self != nil) { diff --git a/sparkle-cli/SUCommandLineUserDriver.h b/sparkle-cli/SUCommandLineUserDriver.h index 64790cbb..0aa79e1b 100644 --- a/sparkle-cli/SUCommandLineUserDriver.h +++ b/sparkle-cli/SUCommandLineUserDriver.h @@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN @interface SUCommandLineUserDriver : NSObject -- (instancetype)initWithApplicationBundle:(NSBundle *)applicationBundle updatePermission:(nullable SUUpdatePermissionPromptResult *)updatePermission deferInstallation:(BOOL)deferInstallation verbose:(BOOL)verbose; +- (instancetype)initWithApplicationBundle:(NSBundle *)applicationBundle updatePermission:(nullable SUUpdatePermission *)updatePermission deferInstallation:(BOOL)deferInstallation verbose:(BOOL)verbose; @end diff --git a/sparkle-cli/SUCommandLineUserDriver.m b/sparkle-cli/SUCommandLineUserDriver.m index 334bde7c..8872070d 100644 --- a/sparkle-cli/SUCommandLineUserDriver.m +++ b/sparkle-cli/SUCommandLineUserDriver.m @@ -14,7 +14,7 @@ @interface SUCommandLineUserDriver () @property (nonatomic, readonly) NSBundle *applicationBundle; -@property (nonatomic, nullable, readonly) SUUpdatePermissionPromptResult *updatePermission; +@property (nonatomic, nullable, readonly) SUUpdatePermission *updatePermission; @property (nonatomic, readonly) BOOL deferInstallation; @property (nonatomic, readonly) BOOL verbose; @property (nonatomic, readonly) SUUserDriverCoreComponent *coreComponent; @@ -33,7 +33,7 @@ @synthesize bytesDownloaded = _bytesDownloaded; @synthesize bytesToDownload = _bytesToDownload; -- (instancetype)initWithApplicationBundle:(NSBundle *)applicationBundle updatePermission:(nullable SUUpdatePermissionPromptResult *)updatePermission deferInstallation:(BOOL)deferInstallation verbose:(BOOL)verbose +- (instancetype)initWithApplicationBundle:(NSBundle *)applicationBundle updatePermission:(nullable SUUpdatePermission *)updatePermission deferInstallation:(BOOL)deferInstallation verbose:(BOOL)verbose { self = [super init]; if (self != nil) { @@ -86,7 +86,7 @@ }); } -- (void)requestUpdatePermissionWithSystemProfile:(NSArray *)__unused systemProfile reply:(void (^)(SUUpdatePermissionPromptResult *))reply +- (void)requestUpdatePermissionWithSystemProfile:(NSArray *)__unused systemProfile reply:(void (^)(SUUpdatePermission *))reply { dispatch_async(dispatch_get_main_queue(), ^{ if (self.updatePermission == nil) { @@ -95,7 +95,7 @@ exit(EXIT_FAILURE); } else { if (self.verbose) { - fprintf(stderr, "Granting permission for automatic update checks with sending system profile %s...\n", self.updatePermission.shouldSendProfile ? "enabled" : "disabled"); + fprintf(stderr, "Granting permission for automatic update checks with sending system profile %s...\n", self.updatePermission.sendProfile ? "enabled" : "disabled"); } reply(self.updatePermission); } diff --git a/sparkle-cli/main.m b/sparkle-cli/main.m index a0c82fbc..3c9acf0c 100644 --- a/sparkle-cli/main.m +++ b/sparkle-cli/main.m @@ -92,9 +92,9 @@ int main(int argc, char **argv) return EXIT_FAILURE; } - SUUpdatePermissionPromptResult *updatePermission = nil; + SUUpdatePermission *updatePermission = nil; if (grantAutomaticChecking) { - updatePermission = [SUUpdatePermissionPromptResult updatePermissionPromptResultWithChoice:SUAutomaticallyCheck shouldSendProfile:sendProfile]; + updatePermission = [SUUpdatePermission updatePermissionWithChoice:SUAutomaticallyCheck sendProfile:sendProfile]; } SUCommandLineDriver *driver = [[SUCommandLineDriver alloc] initWithUpdateBundlePath:updatePath applicationBundlePath:applicationPath updatePermission:updatePermission deferInstallation:deferInstall verbose:verbose];