Mercurial > trustbridge
annotate ui/downloader.cpp @ 11:7e2f14c7aba2
Split up downloader component and further implement it
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Fri, 14 Feb 2014 11:20:15 +0000 |
parents | fe39d93f1261 |
children | 9121eea6d93f |
rev | line source |
---|---|
10
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
1 #include "downloader.h" |
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
2 |
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
3 #ifndef DOWNLOAD_SERVER |
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
4 #define DOWNLOAD_SERVER "https://www.intevation.de" |
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
5 #endif |
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
6 |
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
7 #ifdef Q_OS_WIN |
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
8 #endif |
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
9 |
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
10 #include <QFile> |
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
11 #include <QDebug> |
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
12 |
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
13 Downloader::Downloader(QObject* parent, const QString& url) |
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
14 { |
11
7e2f14c7aba2
Split up downloader component and further implement it
Andre Heinecke <aheinecke@intevation.de>
parents:
10
diff
changeset
|
15 QFile certResource(":certificates/https"); |
7e2f14c7aba2
Split up downloader component and further implement it
Andre Heinecke <aheinecke@intevation.de>
parents:
10
diff
changeset
|
16 certResource.open(QFile::ReadOnly); |
7e2f14c7aba2
Split up downloader component and further implement it
Andre Heinecke <aheinecke@intevation.de>
parents:
10
diff
changeset
|
17 Downloader (parent, url, certResource.readAll()); |
10
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
18 } |
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
19 |
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
20 Downloader::Downloader(QObject* parent, const QString& url, |
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
21 const QByteArray& certificate) : |
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
22 mUrl(url), |
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
23 mCert(certificate), |
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
24 QThread(parent) |
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
25 { |
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
26 } |
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
27 |