Mercurial > trustbridge
comparison ui/downloader.cpp @ 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 | 5834b340c54c |
comparison
equal
deleted
inserted
replaced
459:34cc448409ec | 460:f8bed9008362 |
---|---|
32 Downloader::Downloader(QObject* parent, const QString& url, | 32 Downloader::Downloader(QObject* parent, const QString& url, |
33 const QByteArray& certificate, | 33 const QByteArray& certificate, |
34 const QDateTime& newestSW, | 34 const QDateTime& newestSW, |
35 const QDateTime& newestList, | 35 const QDateTime& newestList, |
36 const QString& resourceSW, | 36 const QString& resourceSW, |
37 const QString& resourceList): | 37 const QString& resourceList, |
38 bool downloadSW): | |
38 QThread(parent), | 39 QThread(parent), |
39 mLastModSW(newestSW), | 40 mLastModSW(newestSW), |
40 mLastModList(newestList), | 41 mLastModList(newestList), |
41 mResourceSW(resourceSW), | 42 mResourceSW(resourceSW), |
42 mResourceList(resourceList), | 43 mResourceList(resourceList), |
44 mDownloadSW(downloadSW), | |
43 mSSLConnection(url, certificate) | 45 mSSLConnection(url, certificate) |
44 { | 46 { |
45 } | 47 } |
46 | 48 |
47 | 49 |
230 .append(remoteModSW.toString("yyyyMMddHHmmss")) | 232 .append(remoteModSW.toString("yyyyMMddHHmmss")) |
231 .append(".exe"); | 233 .append(".exe"); |
232 | 234 |
233 qDebug() << "fileName: " << fileName; | 235 qDebug() << "fileName: " << fileName; |
234 | 236 |
235 if (!downloadFile(mResourceSW, fileName, MAX_SW_SIZE)) { | 237 if (mDownloadSW) { |
236 return; | 238 if (!downloadFile(mResourceSW, fileName, MAX_SW_SIZE)) { |
239 return; | |
240 } | |
237 } | 241 } |
238 | 242 |
239 emit newSoftwareAvailable(fileName, remoteModSW); | 243 emit newSoftwareAvailable(fileName, remoteModSW); |
240 return; | 244 return; |
241 } | 245 } |