1 #ifndef FILEDOWNLOADER_H 2 #define FILEDOWNLOADER_H 5 #include <qbytearray.h> 6 #include <qnetworkaccessmanager.h> 7 #include <qnetworkrequest.h> 8 #include <qnetworkreply.h> 18 explicit FileDownloader(QUrl imageUrl,
int nrOfAllowedRedirects = 0, QObject *parent = 0);
22 enum Status { sRunning, sAborted, sFinished, sError };
44 QNetworkAccessManager m_WebCtrl;
46 QByteArray m_DownloadedData;
48 QNetworkReply *m_pCurrentNetworkReply;
50 qint64 m_bytesReceived;
53 int m_nrOfAllowedRedirects;
59 #endif // FILEDOWNLOADER_H Definition: fileDownloader.h:14
Status getStatus(QString &errorMsg)
Returns the status of a download.
Definition: fileDownloader.cpp:76
Definition: apiFunctionsGraph.cpp:39
int checkRedirect(QString &errorMsg)
This function checks if the given error message is caused by a redirect.
Definition: fileDownloader.cpp:171
void fileDownloaded(QNetworkReply *pReply)
This function is called when the download is finished.
Definition: fileDownloader.cpp:140
int getDownloadProgress()
This functions returns the downloadprogress of a file.
Definition: fileDownloader.cpp:57
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
Setting method to set the meber variables.
Definition: fileDownloader.cpp:126
void abortDownload()
Aboarts a download.
Definition: fileDownloader.cpp:42
QByteArray downloadedData() const
This function returns the downloaded data.
Definition: fileDownloader.cpp:160