changeset 997:405c97ca4ab0

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.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 01 Sep 2014 16:18:10 +0200
parents 29783ef4da62
children 0570b1e562c2
files ui/mainwindow.cpp
diffstat 1 files changed, 6 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- 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();
 }

http://wald.intevation.org/projects/trustbridge/