mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-27 05:04:27 +00:00
Merge pull request #432 from yetamrra/master
Add delegate method for errors
This commit is contained in:
commit
7e1b47976d
4 files changed
+35
-4
No files matched your search
Vendored
+10
-2
@@ -180,10 +180,18 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
|
||||
|
||||
- (void)abortUpdateWithError:(NSError *)error
|
||||
{
|
||||
if (self.showErrors)
|
||||
if (self.showErrors) {
|
||||
[super abortUpdateWithError:error];
|
||||
else
|
||||
} else {
|
||||
// Call delegate separately here because otherwise it won't know we stopped.
|
||||
// Normally this gets called by the superclass
|
||||
id<SUUpdaterDelegate> updaterDelegate = [self.updater delegate];
|
||||
if ([updaterDelegate respondsToSelector:@selector(updater:didAbortWithError:)]) {
|
||||
[updaterDelegate updater:self.updater didAbortWithError:error];
|
||||
}
|
||||
|
||||
[self abortUpdate];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
Vendored
+7
@@ -436,6 +436,13 @@
|
||||
if (self.download) {
|
||||
[self.download cancel];
|
||||
}
|
||||
|
||||
// Notify host app that update has aborted
|
||||
id<SUUpdaterDelegate> updaterDelegate = [self.updater delegate];
|
||||
if ([updaterDelegate respondsToSelector:@selector(updater:didAbortWithError:)]) {
|
||||
[updaterDelegate updater:self.updater didAbortWithError:error];
|
||||
}
|
||||
|
||||
[self abortUpdate];
|
||||
}
|
||||
|
||||
|
||||
Vendored
+10
-2
@@ -43,10 +43,18 @@
|
||||
|
||||
- (void)abortUpdateWithError:(NSError *)error
|
||||
{
|
||||
if (self.showErrors)
|
||||
if (self.showErrors) {
|
||||
[super abortUpdateWithError:error];
|
||||
else
|
||||
} else {
|
||||
// Call delegate separately here because otherwise it won't know we stopped.
|
||||
// Normally this gets called by the superclass
|
||||
id<SUUpdaterDelegate> updaterDelegate = [self.updater delegate];
|
||||
if ([updaterDelegate respondsToSelector:@selector(updater:didAbortWithError:)]) {
|
||||
[updaterDelegate updater:self.updater didAbortWithError:error];
|
||||
}
|
||||
|
||||
[self abortUpdate];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
Vendored
+8
@@ -312,6 +312,14 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey;
|
||||
*/
|
||||
- (void)updater:(SUUpdater *)updater didCancelInstallUpdateOnQuit:(SUAppcastItem *)item;
|
||||
|
||||
/*!
|
||||
Called after an update is aborted due to an error.
|
||||
|
||||
\param updater The SUUpdater instance.
|
||||
\param error The error that caused the abort
|
||||
*/
|
||||
- (void)updater:(SUUpdater *)updater didAbortWithError:(NSError *)error;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user