changeset 1127:1a5f9e260099

(issue130) Remove USE_REAL_RESOURCE option and implement behavior as descript in the issue
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 17 Sep 2014 13:13:19 +0200
parents a07030035349
children 3ee529f42974
files ui/mainwindow.cpp
diffstat 1 files changed, 14 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ui/mainwindow.cpp	Wed Sep 17 12:14:07 2014 +0200
+++ b/ui/mainwindow.cpp	Wed Sep 17 13:13:19 2014 +0200
@@ -66,7 +66,7 @@
 #define TB_ARCH_STRING "-amd64"
 #endif
 
-#ifdef USE_REAL_RESOURCES
+#ifdef IS_TAG_BUILD
 # define LIST_RESOURCE "/zertifikatsliste.txt"
 # ifdef Q_OS_WIN
 #  define SW_RESOURCE_VERSION "/TrustBridge-%1.exe"
@@ -75,13 +75,13 @@
 #  define SW_RESOURCE_VERSION "/TrustBridge-%1" TB_ARCH_STRING ".sh"
 #  define SW_RESOURCE "/TrustBridge" TB_ARCH_STRING ".sh"
 # endif
-#else // RELEASE_BUILD
+#else // Not tag build means develpment build
 # define LIST_RESOURCE "/zertifikatsliste.txt"
 # ifdef Q_OS_WIN
-#  define SW_RESOURCE_VERSION "/development/TrustBridge-development.exe"
+#  define SW_RESOURCE_VERSION "/development/TrustBridge-%1.exe"
 #  define SW_RESOURCE "/development/TrustBridge.exe"
 # else
-#  define SW_RESOURCE_VERSION "/development/TrustBridge-development" TB_ARCH_STRING ".sh"
+#  define SW_RESOURCE_VERSION "/development/TrustBridge-%1" TB_ARCH_STRING ".sh"
 #  define SW_RESOURCE "/development/TrustBridge" TB_ARCH_STRING ".sh"
 # endif
 #endif
@@ -222,6 +222,7 @@
     QString swFileName = mSettings.value("Software/available").toString();
 
     if (swFileName.isEmpty()) {
+        qDebug() << "Date set but no fileName";
         mSettings.remove("Software/availableDate");
         return;
     }
@@ -538,7 +539,6 @@
             this, SLOT(downloaderError(const QString &, SSLConnection::ErrorCode)));
     connect(downloader, SIGNAL(lastModifiedDate(const QDateTime&)),
         this, SLOT(setLastModifiedSWDate(const QDateTime&)));
-
     downloader->start();
 }
 
@@ -563,6 +563,15 @@
         showErrorMessage(tr("Failed to check for updates:") + "\n"  + message);
     }
     setState(TransferError);
+
+#ifndef IS_TAG_BUILD
+    /* For development versions we default to datetime::now if
+     * we can not find our version. */
+    if (!mSettings.contains("Software/installedDate") ||
+          mSettings.value("Software/installedVersion").toString() != QApplication::applicationVersion()) {
+        setLastModifiedSWDate(QDateTime::currentDateTime());
+    }
+#endif
 }
 
 void MainWindow::createActions()

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