Pass item to updaterShouldShowUpdateAlertForScheduledUpdate delegate method

This commit is contained in:
George Nachman committed 2019-03-09 14:58:08 -08:00
1 parent 9f01fd303c
commit 9b6346516e
4 files changed
+9 -9

No files matched your search

+4 -4
View File
@@ -47,15 +47,15 @@
return YES;
}
- (BOOL)shouldShowUpdateAlert {
- (BOOL)shouldShowUpdateAlertForItem:(SUAppcastItem *)item {
id<SUUpdaterPrivate> updater = self.updater;
id<SUUpdaterDelegate> updaterDelegate = [updater delegate];
if ([updaterDelegate respondsToSelector:@selector(updaterShouldShowUpdateAlertForScheduledUpdate:)]) {
return [updaterDelegate updaterShouldShowUpdateAlertForScheduledUpdate:self.updater];
if ([updaterDelegate respondsToSelector:@selector(updaterShouldShowUpdateAlertForScheduledUpdate:forItem:)]) {
return [updaterDelegate updaterShouldShowUpdateAlertForScheduledUpdate:self.updater forItem:item];
}
return [super shouldShowUpdateAlert];
return [super shouldShowUpdateAlertForItem:item];
}
@end
+1 -1
View File
@@ -20,7 +20,7 @@
- (void)showAlert:(NSAlert *)alert;
- (IBAction)cancelDownload:(id)sender;
- (void)installAndRestart:(id)sender;
- (BOOL)shouldShowUpdateAlert;
- (BOOL)shouldShowUpdateAlertForItem:(SUAppcastItem *)item;
@end
+3 -3
View File
@@ -56,7 +56,7 @@
return self;
}
- (BOOL)shouldShowUpdateAlert {
- (BOOL)shouldShowUpdateAlertForItem:(SUAppcastItem *)__unused item {
return YES;
}
@@ -72,12 +72,12 @@
return;
}
if (![self shouldShowUpdateAlert]) {
SUAppcastItem *updateItem = self.updateItem;
if (![self shouldShowUpdateAlertForItem:updateItem]) {
[self abortUpdate];
return;
}
SUAppcastItem *updateItem = self.updateItem;
self.updateAlert = [[SUUpdateAlert alloc] initWithAppcastItem:updateItem host:self.host completionBlock:^(SUUpdateAlertChoice choice) {
[self updateAlertFinishedWithChoice:choice forItem:updateItem];
}];
+1 -1
View File
@@ -124,7 +124,7 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey;
\return YES to allow the update prompt to be shown (the default behavior), or NO to suppress it.
*/
- (BOOL)updaterShouldShowUpdateAlertForScheduledUpdate:(SUUpdater *)updater;
- (BOOL)updaterShouldShowUpdateAlertForScheduledUpdate:(SUUpdater *)updater forItem:(SUAppcastItem *)item;
/*!
Called after the user dismisses the update alert.