File indexing completed on 2024-04-21 05:48:32

0001 /*
0002     SPDX-FileCopyrightText: 2021 Aleix Pol Gonzalez <aleixpol@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef FETCHISOJOB_H
0008 #define FETCHISOJOB_H
0009 
0010 #include <QNetworkAccessManager>
0011 
0012 class FetchIsoJob : public QObject
0013 {
0014     Q_OBJECT
0015 public:
0016     FetchIsoJob(QObject *parent);
0017 
0018     void fetch(const QUrl &url);
0019     QUrl fetchUrl() const {
0020         return m_fetchUrl;
0021     }
0022 
0023 Q_SIGNALS:
0024     void failed();
0025     void finished(const QString &destination);
0026     void downloadProgressChanged(int percentage);
0027 
0028 private:
0029     QNetworkReply *downloadFile(const QUrl &url);
0030 
0031     QNetworkAccessManager m_network;
0032     QUrl m_fetchUrl;
0033     QString cache;
0034 };
0035 
0036 #endif // FETCHISOJOB_H