[PATCH 1 of 6] (issue44) also accept that an update happened if the current version is newer

Wald Commits scm-commit at wald.intevation.org
Fri Sep 26 15:26:20 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1411723872 -7200
# Node ID 8ceaa189570df2371e93fae45a022153b67cf4a0
# Parent  2a1aa9df8f11485ef7e042d1b616b1aa8fa49b0b
(issue44) also accept that an update happened if the current version is newer

diff -r 2a1aa9df8f11 -r 8ceaa189570d ui/mainwindow.cpp
--- a/ui/mainwindow.cpp	Thu Sep 25 17:58:12 2014 +0200
+++ b/ui/mainwindow.cpp	Fri Sep 26 11:31:12 2014 +0200
@@ -514,12 +514,12 @@
 
     QDateTime swAvailableLastMod = mSettings.value("Software/availableDate").toDateTime();
 
-    if (swAvailableLastMod.isValid()) {
-        qDebug() << "Installed an update: " << swInstalledLastMod <<
-            " available " << swAvailableLastMod;
-        syslog_info_printf ("Software has been updated to version: %s\n",
+    if (swAvailableLastMod.isValid() && swInstalledLastMod.isValid()) {
+        if (swInstalledLastMod >= swAvailableLastMod) {
+            qDebug() << "Installed an update: " << swInstalledLastMod <<
+                " available " << swAvailableLastMod;
+            syslog_info_printf ("Software has been updated to version: %s\n",
                 QApplication::applicationVersion().toUtf8().constData());
-        if (swInstalledLastMod == swAvailableLastMod) {
             QString fileName = mSettings.value("Software/available").toString();
             if (fileName.isEmpty()) {
                 qDebug() << "Software marked as available but no filename set.";


More information about the Trustbridge-commits mailing list