List of all members.
Public Types |
enum | Status { sRunning,
sAborted,
sFinished,
sError
} |
Public Member Functions |
| FileDownloader (QUrl imageUrl, int nrOfAllowedRedirects=0, QObject *parent=0) |
QByteArray | downloadedData () const |
| This function returns the downloaded data.
|
void | abortDownload () |
| Aboarts a download.
|
int | getDownloadProgress () |
| This functions returns the downloadprogress of a file.
|
Status | getStatus (QString &errorMsg) |
| Returns the status of a download.
|
Private Slots |
void | fileDownloaded (QNetworkReply *pReply) |
| This function is called when the download is finished.
|
void | downloadProgress (qint64 bytesReceived, qint64 bytesTotal) |
| Setting method to set the meber variables.
|
Private Member Functions |
int | checkRedirect (QString &errorMsg) |
| This function checks if the given error message is caused by a redirect.
|
Private Attributes |
QNetworkAccessManager | m_WebCtrl |
QByteArray | m_DownloadedData |
QNetworkReply * | m_pCurrentNetworkReply |
qint64 | m_bytesReceived |
qint64 | m_bytesTotal |
int | m_nrOfAllowedRedirects |
Member Function Documentation
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 |
|
) |
| [private, slot] |
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 | ) |
[private, slot] |
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:
- K:/git-itom/sources/itom/Qitom/helper/fileDownloader.h
- K:/git-itom/sources/itom/Qitom/helper/fileDownloader.cpp