Sparkle: Delegate calls work now with 1.18.1 (maybe even before)
authorMarkus Goetz <markus@woboq.com>
Wed, 16 May 2018 09:29:27 +0000 (11:29 +0200)
committerCamila (Rebase PR Action) <hello@camila.codes>
Tue, 24 Nov 2020 18:22:33 +0000 (18:22 +0000)
We can extend on this to give UI feedback.

src/gui/updater/sparkleupdater_mac.mm

index 88c3541ff9d550b302459d088fc75b49bea5d007..cfb1189ad2b4043e2fd061f750a108453eb249b0 100644 (file)
 #include "common/utility.h"
 #include "updater/sparkleupdater.h"
 
-// Does not work yet
 @interface DelegateObject : NSObject <SUUpdaterDelegate>
 - (BOOL)updaterMayCheckForUpdates:(SUUpdater *)bundle;
 @end
 @implementation DelegateObject //(SUUpdaterDelegateInformalProtocol)
 
-// Only possible in later versions, we're not up to date here.
 - (BOOL)updaterMayCheckForUpdates:(SUUpdater *)bundle
 {
     Q_UNUSED(bundle)
 {
     Q_UNUSED(updater)
     Q_UNUSED(update)
+    qCDebug(OCC::lcUpdater) << "";
 }
 
 // Sent when a valid update is not found.
-// Does not seem to get called ever.
 - (void)updaterDidNotFindUpdate:(SUUpdater *)update
 {
     Q_UNUSED(update)
+    qCDebug(OCC::lcUpdater) << "";
 }
 
 // Sent immediately before installing the specified update.
 {
     Q_UNUSED(updater)
     Q_UNUSED(update)
+    qCDebug(OCC::lcUpdater) << "";
 }
 
-// Tried implementing those methods, but they never ever seem to get called
-//- (void) updater:(SUUpdater *)updater didAbortWithError:(NSError *)error
-//{
-//}
+- (void) updater:(SUUpdater *)updater didAbortWithError:(NSError *)error
+{
+    Q_UNUSED(updater)
+    qCDebug(OCC::lcUpdater) << error.description;
+}
 
-//- (void)updater:(SUUpdater *)updater didFinishLoadingAppcast:(SUAppcast *)appcast
-//{
-//}
+- (void)updater:(SUUpdater *)updater didFinishLoadingAppcast:(SUAppcast *)appcast
+{
+    Q_UNUSED(updater)
+    Q_UNUSED(appcast)
+    qCDebug(OCC::lcUpdater) << "";
+}
 
 
 @end