]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Add q pointer to SparkleInterface
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 22 Feb 2023 22:06:50 +0000 (23:06 +0100)
committerMatthieu Gallien <matthieu_gallien@yahoo.fr>
Sat, 22 Jul 2023 09:16:39 +0000 (11:16 +0200)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/updater/sparkleupdater_mac.mm

index 33769bbe1e1411f85ed28b605260b2bc83dd44af..04636cf79417af8010d2abf360603120e686de1a 100644 (file)
@@ -93,6 +93,11 @@ namespace OCC {
 class Q_DECL_HIDDEN SparkleUpdater::SparkleInterface
 {
 public:
+    explicit SparkleInterface(SparkleUpdater *parent)
+        : q(parent)
+    {
+    }
+
     ~SparkleInterface()
     {
         [updater release];
@@ -101,12 +106,15 @@ public:
 
     SUUpdater* updater;
     NCSparkleUpdaterDelegate *delegate;
+
+private:
+    SparkleUpdater * const q;
 };
 
 // Delete ~/Library//Preferences/com.owncloud.desktopclient.plist to re-test
 SparkleUpdater::SparkleUpdater(const QUrl& appCastUrl)
     : Updater()
-    , _interface(std::make_unique<SparkleInterface>())
+    , _interface(std::make_unique<SparkleInterface>(this))
 {
     _interface->delegate = [[NCSparkleUpdaterDelegate alloc] init];
     [_interface->delegate retain];
@@ -153,7 +161,6 @@ bool autoUpdaterAllowed()
     return true;
 }
 
-
 void SparkleUpdater::checkForUpdate()
 {
     qCDebug(OCC::lcUpdater) << "Checking for updates.";