changeset 460:f8bed9008362

Added switch to download new available software.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 23 Apr 2014 16:34:41 +0200
parents 34cc448409ec
children 1ce835c40eb7
files ui/downloader.cpp ui/downloader.h
diffstat 2 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ui/downloader.cpp	Wed Apr 23 13:47:33 2014 +0000
+++ b/ui/downloader.cpp	Wed Apr 23 16:34:41 2014 +0200
@@ -34,12 +34,14 @@
                        const QDateTime& newestSW,
                        const QDateTime& newestList,
                        const QString& resourceSW,
-                       const QString& resourceList):
+                       const QString& resourceList,
+                       bool downloadSW):
     QThread(parent),
     mLastModSW(newestSW),
     mLastModList(newestList),
     mResourceSW(resourceSW),
     mResourceList(resourceList),
+    mDownloadSW(downloadSW),
     mSSLConnection(url, certificate)
 {
 }
@@ -232,8 +234,10 @@
 
         qDebug() << "fileName: " << fileName;
 
-        if (!downloadFile(mResourceSW, fileName, MAX_SW_SIZE)) {
-            return;
+        if (mDownloadSW) {
+            if (!downloadFile(mResourceSW, fileName, MAX_SW_SIZE)) {
+                return;
+            }
         }
 
         emit newSoftwareAvailable(fileName, remoteModSW);
--- a/ui/downloader.h	Wed Apr 23 13:47:33 2014 +0000
+++ b/ui/downloader.h	Wed Apr 23 16:34:41 2014 +0200
@@ -49,7 +49,8 @@
                const QDateTime& newestSW = QDateTime(),
                const QDateTime& newestList = QDateTime(),
                const QString& resourceSW = QString(),
-               const QString& resourceList = QString());
+               const QString& resourceList = QString(),
+               bool downloadSW = true);
 
     ~Downloader();
 
@@ -80,6 +81,8 @@
     QString mResourceSW;
     QString mResourceList;
 
+    bool mDownloadSW;
+
     SSLConnection mSSLConnection;
 
     /** @brief get the last modified header of a resource.

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