remove support for skipping an update: hard to understand for users
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Wed, 28 Sep 2022 09:37:37 +0000 (11:37 +0200)
committerMatthieu Gallien <matthieu_gallien@yahoo.fr>
Wed, 12 Oct 2022 10:13:45 +0000 (12:13 +0200)
skiping an update is probably there for historical reasons to work
around broken updates in the past

this can lead to users not getting an update they should be getting

this can elad to user confusion and the current user interaction is
broken if you do not go read the settings file with a text editor

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/gui/updater/ocupdater.cpp
src/gui/updater/ocupdater.h

index 6c056024f6cf59476399b737c09ba0562b503650..4c036321f8bc5f15ac1903e7aff69c08c507c043 100644 (file)
 
 namespace OCC {
 
-static const char updateAvailableC[] = "Updater/updateAvailable";
-static const char updateTargetVersionC[] = "Updater/updateTargetVersion";
-static const char updateTargetVersionStringC[] = "Updater/updateTargetVersionString";
-static const char seenVersionC[] = "Updater/seenVersion";
-static const char autoUpdateAttemptedC[] = "Updater/autoUpdateAttempted";
-
+namespace {
+const auto updateAvailableC = QStringLiteral("Updater/updateAvailable");
+const auto updateTargetVersionC = QStringLiteral("Updater/updateTargetVersion");
+const auto updateTargetVersionStringC = QStringLiteral("Updater/updateTargetVersionString");
+const auto autoUpdateAttemptedC = QStringLiteral("Updater/autoUpdateAttempted");
+}
 
 UpdaterScheduler::UpdaterScheduler(QObject *parent)
     : QObject(parent)
@@ -347,12 +347,9 @@ void NSISUpdater::versionInfoArrived(const UpdateInfo &info)
     ConfigFile cfg;
     QSettings settings(cfg.configFile(), QSettings::IniFormat);
     qint64 infoVersion = Helper::stringVersionToInt(info.version());
-    auto seenString = settings.value(seenVersionC).toString();
-    qint64 seenVersion = Helper::stringVersionToInt(seenString);
     qint64 currVersion = Helper::currentVersionToInt();
     qCInfo(lcUpdater) << "Version info arrived:"
             << "Your version:" << currVersion
-            << "Skipped version:" << seenVersion << seenString
             << "Available version:" << infoVersion << info.version()
             << "Available version string:" << info.versionString()
             << "Web url:" << info.web()
@@ -423,15 +420,12 @@ void NSISUpdater::showNoUrlDialog(const UpdateInfo &info)
     hlayout->addWidget(lbl);
 
     auto *bb = new QDialogButtonBox;
-    QPushButton *skip = bb->addButton(tr("Skip this version"), QDialogButtonBox::ResetRole);
     QPushButton *reject = bb->addButton(tr("Skip this time"), QDialogButtonBox::AcceptRole);
     QPushButton *getupdate = bb->addButton(tr("Get update"), QDialogButtonBox::AcceptRole);
 
-    connect(skip, &QAbstractButton::clicked, msgBox, &QDialog::reject);
     connect(reject, &QAbstractButton::clicked, msgBox, &QDialog::reject);
     connect(getupdate, &QAbstractButton::clicked, msgBox, &QDialog::accept);
 
-    connect(skip, &QAbstractButton::clicked, this, &NSISUpdater::slotSetSeenVersion);
     connect(getupdate, &QAbstractButton::clicked, this, &NSISUpdater::slotOpenUpdateUrl);
 
     layout->addWidget(bb);
@@ -473,20 +467,14 @@ void NSISUpdater::showUpdateErrorDialog(const QString &targetVersion)
     hlayout->addWidget(lbl);
 
     auto bb = new QDialogButtonBox;
-    auto skip = bb->addButton(tr("Skip this version"), QDialogButtonBox::ResetRole);
     auto askagain = bb->addButton(tr("Ask again later"), QDialogButtonBox::ResetRole);
     auto retry = bb->addButton(tr("Restart and update"), QDialogButtonBox::AcceptRole);
     auto getupdate = bb->addButton(tr("Update manually"), QDialogButtonBox::AcceptRole);
 
-    connect(skip, &QAbstractButton::clicked, msgBox, &QDialog::reject);
     connect(askagain, &QAbstractButton::clicked, msgBox, &QDialog::reject);
     connect(retry, &QAbstractButton::clicked, msgBox, &QDialog::accept);
     connect(getupdate, &QAbstractButton::clicked, msgBox, &QDialog::accept);
 
-    connect(skip, &QAbstractButton::clicked, this, [this]() {
-        wipeUpdateData();
-        slotSetSeenVersion();
-    });
     // askagain: do nothing
     connect(retry, &QAbstractButton::clicked, this, [this]() {
         slotStartInstaller();
@@ -531,13 +519,6 @@ bool NSISUpdater::handleStartup()
     return false;
 }
 
-void NSISUpdater::slotSetSeenVersion()
-{
-    ConfigFile cfg;
-    QSettings settings(cfg.configFile(), QSettings::IniFormat);
-    settings.setValue(seenVersionC, updateInfo().version());
-}
-
 ////////////////////////////////////////////////////////////////////////
 
 PassiveUpdateNotifier::PassiveUpdateNotifier(const QUrl &url)
index f857bb832521430445715efdcbc4c986680611b9..1bbf8b8594ef6b28c70ff443939ac81400f7183b 100644 (file)
@@ -156,7 +156,6 @@ public:
     explicit NSISUpdater(const QUrl &url);
     bool handleStartup() override;
 private slots:
-    void slotSetSeenVersion();
     void slotDownloadFinished();
     void slotWriteFile();