|
enum | Status { sRunning,
sAborted,
sFinished,
sError
} |
|
|
void | fileDownloaded (QNetworkReply *pReply) |
| This function is called when the download is finished. More...
|
|
void | downloadProgress (qint64 bytesReceived, qint64 bytesTotal) |
| Setting method to set the meber variables. More...
|
|
|
int | checkRedirect (QString &errorMsg) |
| This function checks if the given error message is caused by a redirect. More...
|
|
|
QNetworkAccessManager | m_WebCtrl |
|
QByteArray | m_DownloadedData |
|
QNetworkReply * | m_pCurrentNetworkReply |
|
qint64 | m_bytesReceived |
|
qint64 | m_bytesTotal |
|
int | m_nrOfAllowedRedirects |
|
int ito::FileDownloader::checkRedirect |
( |
QString & |
errorMsg | ) |
|
|
private |
This function checks if the given error message is caused by a redirect.
- Parameters
-
- Returns
- returns status of redirection. 0 = ok (no redirection, 1 = redirection, -1 = number of redirections exceeded
QByteArray ito::FileDownloader::downloadedData |
( |
| ) |
const |
This function returns the downloaded data.
- Returns
- returns downloaded data as a QByteArray.
void ito::FileDownloader::downloadProgress |
( |
qint64 |
bytesReceived, |
|
|
qint64 |
bytesTotal |
|
) |
| |
|
privateslot |
Setting method to set the meber variables.
- Parameters
-
bytesReceived | received bytes |
bytesTotal | total size of the downloading file bytes |
- See also
- getDownloadProgress
void ito::FileDownloader::fileDownloaded |
( |
QNetworkReply * |
pReply | ) |
|
|
privateslot |
This function is called when the download is finished.
It stores the downloaded data in a member variable and
- Parameters
-
int ito::FileDownloader::getDownloadProgress |
( |
| ) |
|
This functions returns the downloadprogress of a file.
The progress is returned in percent as an integer between 0 and 100.
- Returns
- downloadprogress in percent.
FileDownloader::Status ito::FileDownloader::getStatus |
( |
QString & |
errorMsg | ) |
|
Returns the status of a download.
The status is returned as a Filedownloader::Status. This enumeration has different states: sRunning, sAborted, sFinished, sError This function also handles redirects!
- Parameters
-
errorMsg | The function stores the message in Qstring thst it can be displayed |
- Returns
- statusmessage of the downlaod
The documentation for this class was generated from the following files:
- D:/itom/sources/itom/Qitom/helper/fileDownloader.h
- D:/itom/sources/itom/Qitom/helper/fileDownloader.cpp