29 #include <QNetworkAccessManager> 30 #include <QNetworkRequest> 31 #include <QNetworkReply> 53 explicit Downloader(QString url, QObject *parent = 0);
56 void start(
bool forced);
79 QString
fullPath (
const QString &path,
const QString &file)
const;
95 #endif // DOWNLOADER_H void signalNewFileDownloaded(QString localpath)
void checkWhetherFileExistsAndDownload()
Private slot: Start downloading if necessary.
QString mLocalPath
Local path of the file to be downloaded.
void downloadIndexFile()
Download index file.
void signalDownloading(QVariant downloading)
void stop()
Stop downloading.
void finalize()
Finalize download.
bool isConnectedToInternet()
Check internet connection.
bool mForcedDownload
Flag for forced download.
Downloader(QString url, QObject *parent=0)
Constructor, resetting the member variables.
void start(bool forced)
Start the downloading process in the background.
void signalNoInternetConnection(QVariant forced)
QNetworkAccessManager mNetworkManager
Instance of the Qt network access manager.
QString mRemotePath
Remote path of the file to be downloaded.
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
Private slot: Download a data chunk and report progress.
QNetworkReply * pNetworkReply
Pointer to the network reply structure.
void initiateDownloadOfNextFile()
Private slot: Initiate download of next file.
QString fullPath(const QString &path, const QString &file) const
Helper function: Construct a full path out of a path and a file name.
Class managing the download of large files from a repository in the background.
QString mIndexFileName
Name of the remote index file.
QFile mFile
File to be written.
bool mIsWaitingForConnection
Flag indicating waiting status.
void signalProgress(QVariant filesRemaining, QVariant percent)
void signalAllFilesDownloaded()
Base class for managing log messages.
QStringList getPathsOfDownloadedFiles()
Get a list of paths of all downloaded files.
void indexFileDownloadFinished(QNetworkReply *pReply)
Private slot: Index file downloaded.
QStringList mIndexOfFiles
The content of the index file as a QStringList.
void downloadComplete(QNetworkReply *pReply)
Private slot: Download completed.
bool mIsDownloading
Flag indicating active download.