diff options
Diffstat (limited to 'src/libs/kdtools/filedownloader_p.h')
-rw-r--r-- | src/libs/kdtools/filedownloader_p.h | 69 |
1 files changed, 39 insertions, 30 deletions
diff --git a/src/libs/kdtools/filedownloader_p.h b/src/libs/kdtools/filedownloader_p.h index 41a430554..23eff08d7 100644 --- a/src/libs/kdtools/filedownloader_p.h +++ b/src/libs/kdtools/filedownloader_p.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) +** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -34,6 +35,10 @@ #include <QtNetwork/QNetworkReply> #include <QNetworkAccessManager> +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include <QNetworkInformation> +#endif + // these classes are not a part of the public API namespace KDUpdater { @@ -46,22 +51,22 @@ public: explicit LocalFileDownloader(QObject *parent = 0); ~LocalFileDownloader(); - bool canDownload() const; - bool isDownloaded() const; - QString downloadedFileName() const; - void setDownloadedFileName(const QString &name); - LocalFileDownloader *clone(QObject *parent = 0) const; + bool canDownload() const override; + bool isDownloaded() const override; + QString downloadedFileName() const override; + void setDownloadedFileName(const QString &name) override; + LocalFileDownloader *clone(QObject *parent = 0) const override; public Q_SLOTS: - void cancelDownload(); + void cancelDownload() override; protected: - void timerEvent(QTimerEvent *te); - void onError(); - void onSuccess(); + void timerEvent(QTimerEvent *te) override; + void onError() override; + void onSuccess() override; private Q_SLOTS: - void doDownload(); + void doDownload() override; private: struct Private; @@ -76,22 +81,22 @@ public: explicit ResourceFileDownloader(QObject *parent = 0); ~ResourceFileDownloader(); - bool canDownload() const; - bool isDownloaded() const; - QString downloadedFileName() const; - void setDownloadedFileName(const QString &name); - ResourceFileDownloader *clone(QObject *parent = 0) const; + bool canDownload() const override; + bool isDownloaded() const override; + QString downloadedFileName() const override; + void setDownloadedFileName(const QString &name) override; + ResourceFileDownloader *clone(QObject *parent = 0) const override; public Q_SLOTS: - void cancelDownload(); + void cancelDownload() override; protected: - void timerEvent(QTimerEvent *te); - void onError(); - void onSuccess(); + void timerEvent(QTimerEvent *te) override; + void onError() override; + void onSuccess() override; private Q_SLOTS: - void doDownload(); + void doDownload() override; private: struct Private; @@ -106,22 +111,22 @@ public: explicit HttpDownloader(QObject *parent = 0); ~HttpDownloader(); - bool canDownload() const; - bool isDownloaded() const; - QString downloadedFileName() const; - void setDownloadedFileName(const QString &name); - HttpDownloader *clone(QObject *parent = 0) const; + bool canDownload() const override; + bool isDownloaded() const override; + QString downloadedFileName() const override; + void setDownloadedFileName(const QString &name) override; + HttpDownloader *clone(QObject *parent = 0) const override; public Q_SLOTS: - void cancelDownload(); + void cancelDownload() override; protected: - void onError(); - void onSuccess(); - void timerEvent(QTimerEvent *event); + void onError() override; + void onSuccess() override; + void timerEvent(QTimerEvent *event) override; private Q_SLOTS: - void doDownload(); + void doDownload() override; void httpReadyRead(); void httpReadProgress(qint64 done, qint64 total); @@ -129,7 +134,11 @@ private Q_SLOTS: void httpDone(bool error); void httpReqFinished(); void onAuthenticationRequired(QNetworkReply *reply, QAuthenticator *authenticator); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) void onNetworkAccessibleChanged(QNetworkAccessManager::NetworkAccessibility accessible); +#else + void onReachabilityChanged(QNetworkInformation::Reachability newReachability); +#endif #ifndef QT_NO_SSL void onSslErrors(QNetworkReply* reply, const QList<QSslError> &errors); #endif |