diff options
author | Jonathan Bauer | 2011-04-24 21:36:26 +0200 |
---|---|---|
committer | Jonathan Bauer | 2011-04-24 21:36:26 +0200 |
commit | 03ac351f38316d8f923f3797aa7dd0deade7ed5d (patch) | |
tree | c01e300c7a92ce728df907fd85e1a514876b6037 /src/downloadmanager.h | |
parent | more old tests... (diff) | |
download | fbgui-03ac351f38316d8f923f3797aa7dd0deade7ed5d.tar.gz fbgui-03ac351f38316d8f923f3797aa7dd0deade7ed5d.tar.xz fbgui-03ac351f38316d8f923f3797aa7dd0deade7ed5d.zip |
url status handling, 5sec delay before closing gui when exiting with failure (not actually returning 1 atm), lots of formatting...
Diffstat (limited to 'src/downloadmanager.h')
-rw-r--r-- | src/downloadmanager.h | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/src/downloadmanager.h b/src/downloadmanager.h index dfb4d03..58bcd53 100644 --- a/src/downloadmanager.h +++ b/src/downloadmanager.h @@ -1,21 +1,21 @@ /* - # Copyright (c) 2010,2011 - RZ Uni Freiburg - # Copyright (c) 2010,2011 - OpenSLX Project - # - # This program/file is free software distributed under the GPL version 2. - # See http://openslx.org/COPYING - # - # If you have any feedback please consult http://openslx.org/feedback and - # send your feedback to feedback@openslx.org - # - # General information about OpenSLX can be found under http://openslx.org - # - # - # Class managing download requests: - # - provides queueing functionality - # - static info: filename, filesize - # - dynamic info: download progress, current speed - # + * Copyright (c) 2010,2011 - RZ Uni Freiburg + * Copyright (c) 2010,2011 - OpenSLX Project + * + * This program/file is free software distributed under the GPL version 2. + * See http://openslx.org/COPYING + * + * If you have any feedback please consult http://openslx.org/feedback and + * send your feedback to feedback@openslx.org + * + * General information about OpenSLX can be found under http://openslx.org + * + * + * Class managing download requests: + * - provides queueing functionality + * - static info: filename, filesize + * - dynamic info: download progress, current speed + * */ #ifndef DOWNLOADMANAGER_H @@ -35,35 +35,34 @@ Q_OBJECT public: DownloadManager(); ~DownloadManager(); - QTime _time; + QTime time; private: // checks for valid download directory, ran once in constructor - void checkDownloadDirectory(); + void check_downloadDirectory(); // private control function for queueing mechanism. void processDownloadRequest(const QUrl& url); // base objects for downloading QNetworkAccessManager* _qnam; - QQueue<QUrl> dlQ; - QNetworkReply* currentDownload; - QFile outfile; - QDir downloadDir; + QQueue<QUrl> _downloadQueue; + QNetworkReply* _currentDownload; + QFile _outfile; + QDir _downloadDir; // download progress variables - int currentProgress, lastProgress; + int _currentProgress, _lastProgress; // download in progress flag - bool dip; + bool _dip; // static counter - static int downloaded; + static int _downloaded; - signals: +signals: // notify sends a message to the javascript interface to be evaluated there void notify(const QString& msg); // downloadInfo sends static information (name, size) to the interface. void downloadInfo(const QString& filename, const double& filesize); // updateProgress sends download progress information to the interface. - void updateProgress(const int& percent, const double& speed, - const QString& unit); + void updateProgress(const int& percent, const double& speed, const QString& unit); // signal emitted when download queue is empty. void downloadQueueEmpty(); |