Fix macOS autoupdater
authorClaudio Cambra <claudio.cambra@gmail.com>
Wed, 23 Mar 2022 08:56:11 +0000 (09:56 +0100)
committerMatthieu Gallien <matthieu_gallien@yahoo.fr>
Mon, 2 May 2022 12:57:47 +0000 (14:57 +0200)
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
VERSION.cmake
src/gui/generalsettings.cpp

index df35bb3ab77a8cc5b39a13e0ef2af0fd02e6a589..66875f1b17151dcf919f05b555a8a1140d0b865a 100644 (file)
@@ -2,6 +2,7 @@ set( MIRALL_VERSION_MAJOR 3 )
 set( MIRALL_VERSION_MINOR 4 )
 set( MIRALL_VERSION_PATCH 83 )
 set( MIRALL_VERSION_YEAR  2022 )
+
 set( MIRALL_SOVERSION 0 )
 
 # Minimum supported server version according to https://docs.nextcloud.com/server/latest/admin_manual/release_schedule.html
index b03282c752506c67cd151c102a343af36a1a95da..20df5809edecd13ee0bd669f4c559e57fa2e5d34 100644 (file)
@@ -301,6 +301,7 @@ void GeneralSettings::slotUpdateInfo()
     else if (auto sparkleUpdater = qobject_cast<SparkleUpdater *>(Updater::instance())) {
         _ui->updateStateLabel->setText(sparkleUpdater->statusString());
         _ui->restartButton->setVisible(false);
+        connect(_ui->updateButton, &QAbstractButton::clicked, this, &GeneralSettings::slotUpdateCheckNow, Qt::UniqueConnection);
     }
 #endif
 
@@ -389,7 +390,11 @@ void GeneralSettings::slotUpdateChannelChanged(const QString &translatedChannel)
 
 void GeneralSettings::slotUpdateCheckNow()
 {
+#if defined(Q_OS_MAC) && defined(HAVE_SPARKLE)
+    auto *updater = qobject_cast<SparkleUpdater *>(Updater::instance());
+#else
     auto *updater = qobject_cast<OCUpdater *>(Updater::instance());
+#endif
     if (ConfigFile().skipUpdateCheck()) {
         updater = nullptr; // don't show update info if updates are disabled
     }