[PATCH 1 of 2] Save installation success independet of state

Wald Commits scm-commit at wald.intevation.org
Mon Sep 1 19:48:58 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1409581090 -7200
# Node ID 405c97ca4ab072c95d0e0146afa55d1d66deb042
# Parent  29783ef4da62201575c86577d0ca44dd9edae51f
Save installation success independet of state.

    This fixes a bug that you can have a new list available but
    currently a transfer error. Now the actual saving  / removal
    of the old list is only dependent on the list that is available
    in the settings.

diff -r 29783ef4da62 -r 405c97ca4ab0 ui/mainwindow.cpp
--- a/ui/mainwindow.cpp	Mon Sep 01 15:05:48 2014 +0200
+++ b/ui/mainwindow.cpp	Mon Sep 01 16:18:10 2014 +0200
@@ -1109,20 +1109,17 @@
 }
 
 void MainWindow::installerSuccess() {
-    if (mCurState == NewListAvailable || mCurState == NewSoftwareAvailable) {
+    if (mCurState == NewListAvailable ) {
         mCurState = NothingChanged;
         mCurMessage = QString();
+    }
 
-        QString listFileName = mSettings.value("List/available").toString();
-        QDateTime listFileDate = mSettings.value("List/availableDate").toDateTime();
-
+    QString listFileName = mSettings.value("List/available").toString();
+    QDateTime listFileDate = mSettings.value("List/availableDate").toDateTime();
+    if (!listFileName.isEmpty() && listFileDate.isValid()) {
         mSettings.remove("List/available");
         mSettings.remove("List/availableDate");
 
-        if (listFileName.isEmpty() || !listFileDate.isValid()) {
-            qWarning() << "Error accessing settings";
-            return; /* Try again with next check */
-        }
         /* Rename the installed list to list-installed.txt so that external
          * programs (like the uninstaller can easily recognize it). */
         QString dataLoc =
@@ -1159,9 +1156,8 @@
             mSettings.remove("List/installed");
             mSettings.remove("List/installedDate");
         }
-        mListToInstall = CertificateList();
-
     }
+    mListToInstall = CertificateList();
     mUpdatesManual->clear();
     loadCertificateList();
 }


More information about the Trustbridge-commits mailing list