[PATCH 1 of 2] Added switch to download new available software

Wald Commits scm-commit at wald.intevation.org
Wed Apr 23 16:37:41 CEST 2014


# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1398263681 -7200
# Node ID f8bed90083626fbd58fa1b5d5abd57088ee268f6
# Parent  34cc448409ec926134103d2dd35f8c43ca071b97
Added switch to download new available software.

diff -r 34cc448409ec -r f8bed9008362 ui/downloader.cpp
--- 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);
diff -r 34cc448409ec -r f8bed9008362 ui/downloader.h
--- 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.


More information about the Trustbridge-commits mailing list