#if defined(BUILD_UPDATER)
void GeneralSettings::slotUpdateInfo()
{
- if (ConfigFile().skipUpdateCheck()) {
+ if (ConfigFile().skipUpdateCheck() || !Updater::instance()) {
// updater disabled on compile
_ui->updatesGroupBox->setVisible(false);
return;
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)
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()
};
// Delete ~/Library//Preferences/com.owncloud.desktopclient.plist to re-test
-SparkleUpdater::SparkleUpdater(const QString& appCastUrl)
+SparkleUpdater::SparkleUpdater(const QUrl& appCastUrl)
: Updater()
{
d = new Private;
[d->updater resetUpdateCycle];
[d->updater retain];
- NSURL* url = [NSURL URLWithString:
- [NSString stringWithUTF8String: appCastUrl.toUtf8().data()]];
- [d->updater setFeedURL: url];
+ setUpdateUrl(appCastUrl);
// Sparkle 1.8 required
NSString *userAgent = [NSString stringWithUTF8String: Utility::userAgentString().data()];
delete d;
}
+void SparkleUpdater::setUpdateUrl(const QUrl &url)
+{
+ NSURL* nsurl = [NSURL URLWithString:
+ [NSString stringWithUTF8String: url.toString().toUtf8().data()]];
+ [d->updater setFeedURL: nsurl];
+}
+
// FIXME: Should be changed to not instanicate the SparkleUpdater at all in this case
bool autoUpdaterAllowed()
{