summaryrefslogtreecommitdiffstats
path: root/src/downloadManager.h
diff options
context:
space:
mode:
authorJonathan Bauer2011-03-10 16:10:42 +0100
committerJonathan Bauer2011-03-10 16:10:42 +0100
commit550a86ff4852d247d07c35c4a3d6730b6ffa52e7 (patch)
tree4735a792e713b877ffac528f91805d6c129c8d7d /src/downloadManager.h
parenttest function that returns a json, use: fbgui.getNames() (diff)
parent now the getAllInfo() method works. We just return a String (diff)
downloadfbgui-550a86ff4852d247d07c35c4a3d6730b6ffa52e7.tar.gz
fbgui-550a86ff4852d247d07c35c4a3d6730b6ffa52e7.tar.xz
fbgui-550a86ff4852d247d07c35c4a3d6730b6ffa52e7.zip
Merge branch 'master' of git.openslx.org:lsfks/master-teamprojekt/fbgui
Conflicts: src/sysInfo.cpp
Diffstat (limited to 'src/downloadManager.h')
-rw-r--r--src/downloadManager.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/downloadManager.h b/src/downloadManager.h
new file mode 100644
index 0000000..461d31a
--- /dev/null
+++ b/src/downloadManager.h
@@ -0,0 +1,52 @@
+#ifndef DOWNLOADMANAGER_H
+#define DOWNLOADMANAGER_H
+
+#include "fbgui.h"
+#include <QObject>
+#include <QDir>
+#include <QtNetwork>
+
+extern bool debug;
+extern QUrl baseURL;
+extern QString binPath;
+extern QString downloadPath;
+
+
+class downloadManager : public QObject
+{
+ Q_OBJECT
+
+public:
+ downloadManager();
+
+private:
+ void processDownloadRequest(QUrl& url);
+ // Object required for downloading.
+ QNetworkAccessManager* qnam;
+ QQueue<QUrl> dlQ;
+ QNetworkRequest request;
+ QNetworkReply* currentDownload;
+ QFile outfile;
+ QDir downloadDir;
+ // Download-in-progress flag.
+ bool dip;
+ int currentProgress;
+ static int downloaded;
+
+signals:
+ void finished();
+ void updateProgress(QString current, int i);
+ void downloadQueueEmpty();
+
+public slots:
+ void downloadFile(QUrl& fileUrl);
+ void downloadFile(QString& fileUrl);
+
+private slots:
+ void startNextDownload();
+ void downloadReady();
+ void downloadProgress(qint64 bytesIn, qint64 bytesTotal);
+ void downloadFinished();
+};
+
+#endif // DOWNLOADMANAGER_H