HttpDownloader Class

class KDUpdater::HttpDownloader

The HttpDownloader class is used to download files over FTP, HTTP, or HTTPS. More...

Header: #include <HttpDownloader>
Inherits: KDUpdater::FileDownloader

Public Functions

HttpDownloader(QObject *parent = 0)
virtual ~HttpDownloader()

Reimplemented Public Functions

virtual bool canDownload() const override
virtual KDUpdater::HttpDownloader *clone(QObject *parent = 0) const override
virtual QString downloadedFileName() const override
virtual bool isDownloaded() const override
virtual void setDownloadedFileName(const QString &name) override

Public Slots

virtual void cancelDownload() override

Reimplemented Protected Functions

virtual void onError() override
virtual void onSuccess() override
virtual void timerEvent(QTimerEvent *event) override

Detailed Description

HTTPS is supported if Qt is built with SSL.

Member Function Documentation

HttpDownloader::HttpDownloader(QObject *parent = 0)

Creates an HTTP downloader with the parent parent.

[override virtual slot] void HttpDownloader::cancelDownload()

Reimplements: FileDownloader::cancelDownload().

Cancels downloading the file.

[virtual] HttpDownloader::~HttpDownloader()

Destroys an HTTP downloader.

Removes the downloaded file if FileDownloader::isAutoRemoveDownloadedFile() returns true or FileDownloader::setAutoRemoveDownloadedFile() was called with true.

[override virtual] bool HttpDownloader::canDownload() const

Reimplements: FileDownloader::canDownload() const.

Returns true if the file exists and is readable.

[override virtual] KDUpdater::HttpDownloader *HttpDownloader::clone(QObject *parent = 0) const

Reimplements: FileDownloader::clone(QObject *parent) const.

Clones the HTTP downloader and assigns it the parent parent. Returns the new HTTP downloader.

[override virtual] QString HttpDownloader::downloadedFileName() const

Reimplements: FileDownloader::downloadedFileName() const.

Returns the file name of the downloaded file.

See also setDownloadedFileName().

[override virtual] bool HttpDownloader::isDownloaded() const

Reimplements: FileDownloader::isDownloaded() const.

Returns true if the file is downloaded.

[override virtual protected] void HttpDownloader::onError()

Reimplements: FileDownloader::onError().

Closes the destination file if an error occurs during copying and stops the download speed timer.

[override virtual protected] void HttpDownloader::onSuccess()

Reimplements: FileDownloader::onSuccess().

Closes the destination file after it has been successfully copied and stops the download speed timer.

[override virtual] void HttpDownloader::setDownloadedFileName(const QString &name)

Reimplements: FileDownloader::setDownloadedFileName(const QString &name).

Sets the file name of the downloaded file to name.

See also downloadedFileName().

[override virtual protected] void HttpDownloader::timerEvent(QTimerEvent *event)

Called when the download timer event event occurs.