From 9c100a974935e34d44e606d77c85c7c4e4ed6239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Mon, 15 Dec 2025 12:00:21 +0100 Subject: [PATCH 1/2] [DC-158] chore: remove ownCloud 10 update channel --- src/gui/aboutdialog.cpp | 68 ----------------------------------- src/gui/aboutdialog.h | 7 +--- src/gui/aboutdialog.ui | 35 +++--------------- src/gui/updater/ocupdater.cpp | 7 ---- src/gui/updater/ocupdater.h | 2 -- src/gui/updater/updater.cpp | 6 ++-- src/libsync/configfile.cpp | 14 ++------ src/libsync/configfile.h | 1 - 8 files changed, 10 insertions(+), 130 deletions(-) diff --git a/src/gui/aboutdialog.cpp b/src/gui/aboutdialog.cpp index c1988a7751b..3416b7e1463 100644 --- a/src/gui/aboutdialog.cpp +++ b/src/gui/aboutdialog.cpp @@ -77,27 +77,10 @@ void AboutDialog::setupUpdaterWidget() if (Utility::isMac()) { // Because we don't have any statusString from the SparkleUpdater anyway we can hide the whole thing ui->updaterWidget->hide(); - } else { - ui->updateChannelLabel->hide(); - ui->updateChannel->hide(); - if (ConfigFile().updateChannel() != QLatin1String("stable")) { - ConfigFile().setUpdateChannel(QStringLiteral("stable")); - } } } - // we want to attach the known english identifiers which are also used within the configuration file as user data inside the data model - // that way, when we intend to reset to the original selection when the dialog, we can look up the config file's stored value in the data model - ui->updateChannel->addItem(QStringLiteral("ownCloud 10 LTS"), QStringLiteral("stable")); - ui->updateChannel->addItem(QStringLiteral("ownCloud Infinite Scale stable"), QStringLiteral("ocis")); - if (!Resources::isVanillaTheme()) { - ui->updateChannel->addItem(tr("beta"), QStringLiteral("beta")); - } if (!ConfigFile().skipUpdateCheck() && Updater::instance()) { - // Channel selection - ui->updateChannel->setCurrentIndex(ui->updateChannel->findData(ConfigFile().updateChannel())); - connect(ui->updateChannel, static_cast(&QComboBox::currentIndexChanged), this, &AboutDialog::slotUpdateChannelChanged); - // Note: the sparkle-updater is not an OCUpdater if (auto *ocupdater = qobject_cast(Updater::instance())) { auto updateInfo = [ocupdater, this] { @@ -144,55 +127,4 @@ void AboutDialog::setupUpdaterWidget() #endif } -void AboutDialog::slotUpdateChannelChanged([[maybe_unused]] int index) -{ -#ifdef WITH_AUTO_UPDATER - QString channel; - if (index < 0) { - // invalid index, reset to stable - channel = QStringLiteral("stable"); - } else { - channel = ui->updateChannel->itemData(index).toString(); - } - if (channel == ConfigFile().updateChannel()) { - return; - } - - auto msgBox = new QMessageBox(QMessageBox::Warning, tr("Change update channel?"), - tr("The update channel determines which client updates will be offered for installation." - "
⚠️Downgrades are not supported. If you switch to a stable channel this change will only be applied with the next major release.") - .arg( - isTestPilotCloudTheme() ? tr("
  • \"beta\" may contain newer features and bugfixes, but have not yet been tested thoroughly
  • ") : QString()), - QMessageBox::NoButton, this); - auto acceptButton = msgBox->addButton(tr("Change update channel"), QMessageBox::AcceptRole); - msgBox->addButton(tr("Cancel"), QMessageBox::RejectRole); - connect(msgBox, &QMessageBox::finished, msgBox, [this, channel, msgBox, acceptButton] { - msgBox->deleteLater(); - if (msgBox->clickedButton() == acceptButton) { - ConfigFile().setUpdateChannel(channel); - if (OCUpdater *updater = qobject_cast(Updater::instance())) { - updater->setUpdateUrl(Updater::updateUrl()); - updater->checkForUpdate(); - } -#if defined(Q_OS_MAC) && defined(HAVE_SPARKLE) - else if (SparkleUpdater *updater = qobject_cast(Updater::instance())) { - updater->setUpdateUrl(Updater::updateUrl()); - updater->checkForUpdate(); - } -#endif - } else { - const auto oldChannel = ui->updateChannel->findData(ConfigFile().updateChannel()); - Q_ASSERT(oldChannel >= 0); - Q_ASSERT(oldChannel <= 1); - ui->updateChannel->setCurrentIndex(oldChannel); - } - }); - msgBox->open(); -#endif -} - } // OCC namespace diff --git a/src/gui/aboutdialog.h b/src/gui/aboutdialog.h index 73056ea5413..e252a8ce639 100644 --- a/src/gui/aboutdialog.h +++ b/src/gui/aboutdialog.h @@ -11,8 +11,7 @@ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. */ -#ifndef ABOUTDIALOG_H -#define ABOUTDIALOG_H +#pragma once #include @@ -36,12 +35,8 @@ class AboutDialog : public QDialog void openBrowserFromUrl(const QUrl &s); void setupUpdaterWidget(); -private Q_SLOTS: - void slotUpdateChannelChanged(int index); - private: Ui::AboutDialog *ui; }; } -#endif // ABOUTDIALOG_H diff --git a/src/gui/aboutdialog.ui b/src/gui/aboutdialog.ui index cc0645ab4b3..14955a8804e 100644 --- a/src/gui/aboutdialog.ui +++ b/src/gui/aboutdialog.ui @@ -31,7 +31,7 @@ - Qt::Vertical + Qt::Orientation::Vertical @@ -66,7 +66,7 @@ - Qt::Vertical + Qt::Orientation::Vertical @@ -96,32 +96,6 @@ - - - - - 0 - 0 - - - - &Update Channel - - - updateChannel - - - - - - - - 0 - 0 - - - - @@ -165,10 +139,10 @@ - Qt::Horizontal + Qt::Orientation::Horizontal - QDialogButtonBox::Ok + QDialogButtonBox::StandardButton::Ok @@ -177,7 +151,6 @@ tabWidget versionInfo - updateChannel restartButton diff --git a/src/gui/updater/ocupdater.cpp b/src/gui/updater/ocupdater.cpp index ca7f0b61081..a4a9d9ffb8b 100644 --- a/src/gui/updater/ocupdater.cpp +++ b/src/gui/updater/ocupdater.cpp @@ -14,7 +14,6 @@ #include "accessmanager.h" #include "application.h" -#include "common/restartmanager.h" #include "common/utility.h" #include "common/version.h" #include "configfile.h" @@ -109,12 +108,6 @@ OCUpdater::OCUpdater(const QUrl &url) { } -void OCUpdater::setUpdateUrl(const QUrl &url) -{ - _updateUrl = url; -} - - void OCUpdater::backgroundCheckForUpdate() { int dlState = downloadState(); diff --git a/src/gui/updater/ocupdater.h b/src/gui/updater/ocupdater.h index c2b1512916b..8e8a945ee56 100644 --- a/src/gui/updater/ocupdater.h +++ b/src/gui/updater/ocupdater.h @@ -117,8 +117,6 @@ class OWNCLOUDGUI_EXPORT OCUpdater : public Updater explicit OCUpdater(const QUrl &url); - void setUpdateUrl(const QUrl &url); - void checkForUpdate() override; QString statusString() const; diff --git a/src/gui/updater/updater.cpp b/src/gui/updater/updater.cpp index 8004b7d4c62..cd9b791d5f1 100644 --- a/src/gui/updater/updater.cpp +++ b/src/gui/updater/updater.cpp @@ -107,9 +107,7 @@ QUrlQuery Updater::getQueryParams() query.addQueryItem(QStringLiteral("versionsuffix"), OCC::Version::suffix()); auto channel = ConfigFile().updateChannel(); - if (channel != QLatin1String("stable")) { - query.addQueryItem(QStringLiteral("channel"), channel); - } + query.addQueryItem("channel", channel); // requested by #11328 // we use the names Qt gives us instead of inventing our own labels @@ -126,7 +124,7 @@ QUrlQuery Updater::getQueryParams() Updater *Updater::create() { auto url = updateUrl(); - qCDebug(lcUpdater) << url; + qCDebug(lcUpdater) << "Updater URL: "<< url.toDisplayString(); if (url.isEmpty()) { qCWarning(lcUpdater) << "Not a valid updater URL, will not do update check"; return nullptr; diff --git a/src/libsync/configfile.cpp b/src/libsync/configfile.cpp index a73fc3c9625..4bfce56a010 100644 --- a/src/libsync/configfile.cpp +++ b/src/libsync/configfile.cpp @@ -59,7 +59,6 @@ const QString optionalDesktopNotificationsC() } const QString skipUpdateCheckC() { return QStringLiteral("skipUpdateCheck"); } const QString updateCheckIntervalC() { return QStringLiteral("updateCheckInterval"); } -const QString updateChannelC() { return QStringLiteral("updateChannel"); } const QString uiLanguageC() { return QStringLiteral("uiLanguage"); } const QString geometryC() { return QStringLiteral("geometry"); } const QString timeoutC() { return QStringLiteral("timeout"); } @@ -491,24 +490,17 @@ void ConfigFile::setSkipUpdateCheck(bool skip, const QString &connection) QString ConfigFile::updateChannel() const { - QString defaultUpdateChannel = QStringLiteral("stable"); + // By now only two channels are supported: ocis and beta-ocis const QString suffix = OCC::Version::suffix(); if (suffix.startsWith(QLatin1String("daily")) || suffix.startsWith(QLatin1String("nightly")) || suffix.startsWith(QLatin1String("alpha")) || suffix.startsWith(QLatin1String("rc")) || suffix.startsWith(QLatin1String("beta"))) { - defaultUpdateChannel = QStringLiteral("beta"); + return "ocis-beta"; } - auto settings = makeQSettings(); - return settings.value(updateChannelC(), defaultUpdateChannel).toString(); -} - -void ConfigFile::setUpdateChannel(const QString &channel) -{ - auto settings = makeQSettings(); - settings.setValue(updateChannelC(), channel); + return "ocis"; } QString ConfigFile::uiLanguage() const diff --git a/src/libsync/configfile.h b/src/libsync/configfile.h index 1c50cd4b95d..a9384cb1e41 100644 --- a/src/libsync/configfile.h +++ b/src/libsync/configfile.h @@ -148,7 +148,6 @@ class OWNCLOUDSYNC_EXPORT ConfigFile void setSkipUpdateCheck(bool, const QString &); QString updateChannel() const; - void setUpdateChannel(const QString &channel); QString uiLanguage() const; void setUiLanguage(const QString &uiLanguage); From 0549b6115354eeb2d616ecacbf7ab83a857bad02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Mon, 15 Dec 2025 16:35:37 +0100 Subject: [PATCH 2/2] fix: move updateChannel() from ConfigFile to the Updater --- src/gui/updater/updater.cpp | 17 ++++++++++++++++- src/libsync/configfile.cpp | 15 --------------- src/libsync/configfile.h | 2 -- test/testupdater.cpp | 2 +- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/gui/updater/updater.cpp b/src/gui/updater/updater.cpp index cd9b791d5f1..f885948700e 100644 --- a/src/gui/updater/updater.cpp +++ b/src/gui/updater/updater.cpp @@ -34,6 +34,21 @@ namespace OCC { Q_LOGGING_CATEGORY(lcUpdater, "gui.updater", QtInfoMsg) +QString updateChannel() +{ + // By now only two channels are supported: ocis and beta-ocis + const QString suffix = OCC::Version::suffix(); + if (suffix.startsWith(QLatin1String("daily")) + || suffix.startsWith(QLatin1String("nightly")) + || suffix.startsWith(QLatin1String("alpha")) + || suffix.startsWith(QLatin1String("rc")) + || suffix.startsWith(QLatin1String("beta"))) { + return "ocis-beta"; + } + + return "ocis"; +} + Updater *Updater::_instance = nullptr; Updater *Updater::instance() @@ -106,7 +121,7 @@ QUrlQuery Updater::getQueryParams() query.addQueryItem(QStringLiteral("versionsuffix"), OCC::Version::suffix()); - auto channel = ConfigFile().updateChannel(); + auto channel = updateChannel(); query.addQueryItem("channel", channel); // requested by #11328 diff --git a/src/libsync/configfile.cpp b/src/libsync/configfile.cpp index 4bfce56a010..096fe2805eb 100644 --- a/src/libsync/configfile.cpp +++ b/src/libsync/configfile.cpp @@ -488,21 +488,6 @@ void ConfigFile::setSkipUpdateCheck(bool skip, const QString &connection) settings.sync(); } -QString ConfigFile::updateChannel() const -{ - // By now only two channels are supported: ocis and beta-ocis - const QString suffix = OCC::Version::suffix(); - if (suffix.startsWith(QLatin1String("daily")) - || suffix.startsWith(QLatin1String("nightly")) - || suffix.startsWith(QLatin1String("alpha")) - || suffix.startsWith(QLatin1String("rc")) - || suffix.startsWith(QLatin1String("beta"))) { - return "ocis-beta"; - } - - return "ocis"; -} - QString ConfigFile::uiLanguage() const { auto settings = makeQSettings(); diff --git a/src/libsync/configfile.h b/src/libsync/configfile.h index a9384cb1e41..e241f35aff9 100644 --- a/src/libsync/configfile.h +++ b/src/libsync/configfile.h @@ -147,8 +147,6 @@ class OWNCLOUDSYNC_EXPORT ConfigFile bool skipUpdateCheck(const QString &connection = QString()) const; void setSkipUpdateCheck(bool, const QString &); - QString updateChannel() const; - QString uiLanguage() const; void setUiLanguage(const QString &uiLanguage); diff --git a/test/testupdater.cpp b/test/testupdater.cpp index 29e70786367..a181671048b 100644 --- a/test/testupdater.cpp +++ b/test/testupdater.cpp @@ -32,7 +32,7 @@ private Q_SLOTS: UpdateInfo info; info.setDownloadUrl(url); info.setVersionString(QStringLiteral("ownCloud 2.2.4 (build 6408)")); - // esnure we do the update + // ensure we do the update info.setVersion(QStringLiteral("100.2.4.6408")); auto *updater = new WindowsUpdater({}); QSignalSpy downloadSpy(updater, &WindowsUpdater::downloadStateChanged);