diff options
author | Christian Kamm <mail@ckamm.de> | 2018-05-18 15:17:13 +0300 |
---|---|---|
committer | Camila (Rebase PR Action) <hello@camila.codes> | 2020-11-24 21:22:33 +0300 |
commit | 4b39731c274d37b305a041bbfa165277f85b50d6 (patch) | |
tree | 193359c4d80a7442b7a7e6d91b3e443749ac891a /src/gui/generalsettings.cpp | |
parent | 311e3a3bd87d6fe30cdd919911abda6be78df7dd (diff) |
Updater: Make sparkle updater respect release channel
Diffstat (limited to 'src/gui/generalsettings.cpp')
-rw-r--r-- | src/gui/generalsettings.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/gui/generalsettings.cpp b/src/gui/generalsettings.cpp index b9081da43..789bc27b3 100644 --- a/src/gui/generalsettings.cpp +++ b/src/gui/generalsettings.cpp @@ -252,7 +252,7 @@ void GeneralSettings::loadMiscSettings() #if defined(BUILD_UPDATER) void GeneralSettings::slotUpdateInfo() { - if (ConfigFile().skipUpdateCheck()) { + if (ConfigFile().skipUpdateCheck() || !Updater::instance()) { // updater disabled on compile _ui->updatesGroupBox->setVisible(false); return; @@ -278,24 +278,18 @@ void GeneralSettings::slotUpdateInfo() ocupdater->downloadState() != OCUpdater::DownloadComplete); _ui->autoCheckForUpdatesCheckBox->setChecked(ConfigFile().autoUpdateCheck()); - - // Channel selection - _ui->updateChannel->setCurrentIndex(ConfigFile().updateChannel() == "beta" ? 1 : 0); - connect(_ui->updateChannel, &QComboBox::currentTextChanged, - this, &GeneralSettings::slotUpdateChannelChanged, Qt::UniqueConnection); } #ifdef Q_OS_MAC else if (auto sparkleUpdater = qobject_cast<SparkleUpdater *>(Updater::instance())) { _ui->updateStateLabel->setText(sparkleUpdater->statusString()); _ui->restartButton->setVisible(false); - - // Channel selection - _ui->updateChannel->setCurrentIndex(ConfigFile().updateChannel() == "beta" ? 1 : 0); - connect(_ui->updateChannel, &QComboBox::currentTextChanged, - this, &GeneralSettings::slotUpdateChannelChanged, Qt::UniqueConnection); } #endif + // Channel selection + _ui->updateChannel->setCurrentIndex(ConfigFile().updateChannel() == "beta" ? 1 : 0); + connect(_ui->updateChannel, &QComboBox::currentTextChanged, + this, &GeneralSettings::slotUpdateChannelChanged, Qt::UniqueConnection); } void GeneralSettings::slotUpdateChannelChanged(const QString &channel) @@ -306,6 +300,12 @@ void GeneralSettings::slotUpdateChannelChanged(const QString &channel) updater->setUpdateUrl(Updater::updateUrl()); updater->checkForUpdate(); } +#ifdef Q_OS_MAC + else if (auto *updater = qobject_cast<SparkleUpdater *>(Updater::instance())) { + updater->setUpdateUrl(Updater::updateUrl()); + updater->checkForUpdate(); + } +#endif } void GeneralSettings::slotUpdateCheckNow() |