LocalFileDownloader Class

(KDUpdater::LocalFileDownloader)

The LocalFileDownloader class is used to copy files from the local file system. More...

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

Public Functions

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

Reimplemented Public Functions

virtual bool canDownload() const override
virtual KDUpdater::LocalFileDownloader *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

Static Public Members

const QMetaObject staticMetaObject

Reimplemented Protected Functions

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

Additional Inherited Members

Detailed Description

The LocalFileDownloader class is used to copy files from the local file system.

The user of KDUpdater might be simultaneously downloading several files; sometimes in parallel to other file downloaders. If copying a local file takes a long time, it will make the other downloads hang. Therefore, a timer is used and one block of data is copied per unit time, even though QFile::copy() does the task of copying local files from one place to another.

Member Function Documentation

LocalFileDownloader::LocalFileDownloader(QObject *parent = 0)

Default constructs an instance of LocalFileDownloader.

[virtual] LocalFileDownloader::~LocalFileDownloader()

Destroys the instance of LocalFileDownloader. The destructor is virtual.

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

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

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

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

See also setDownloadedFileName().

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

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

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

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

See also downloadedFileName().

[override virtual protected] void LocalFileDownloader::timerEvent(QTimerEvent *te)