changeset 1362:c2b76c8a8b82

(issue177) Only install certificate lists which are newer
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 19 Nov 2014 19:07:56 +0100
parents 0f3af6916395
children 3d6faded03dd
files ui/mainwindow.cpp
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ui/mainwindow.cpp	Mon Nov 10 14:01:23 2014 +0100
+++ b/ui/mainwindow.cpp	Wed Nov 19 19:07:56 2014 +0100
@@ -306,13 +306,19 @@
     mSettings.setValue("List/availableDate", modDate);
 
     verifyListData();
-    if (!mListToInstall.isValid()) {
+    if (!mListToInstall.isValid() || mListToInstall.date() <= mInstalledList.date()) {
+        if ( mListToInstall.date() <= mInstalledList.date()) {
+            qDebug() << "Newest list on the server is older then the installed list. ";
+            qDebug() << "Installed: " << mInstalledList.date();
+            qDebug() << "Available: " << mListToInstall.date();
+        } else {
+            qDebug() << "Failed to verify list.";
+        }
         handleLTE(lteInvalidList);
         /* Downloader provided invalid files */
 
         /* Retry the download again in 10 - 20 minutes */
         QTimer::singleShot(600000 + (qrand() % 60000), this, SLOT(checkUpdates()));
-        qDebug() << "Failed to verify list.";
     } else {
         if (mTrayIcon->isAlternative()) {
             mCurMessage = tr("An updated certificate list is available.");

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