Krita Source Code Documentation
Loading...
Searching...
No Matches
KisRemoteFileFetcher.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 Boudewijn Rempt <boud@valdyas.org>
3 * SPDX-FileCopyrightText: 2021 L. E. Segovia <amy@amyspark.me>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 *
7 */
8#ifndef KISREMOTEFILEFETCHER_H
9#define KISREMOTEFILEFETCHER_H
10
11#include <QIODevice>
12#include <QNetworkReply>
13#include <QNetworkRequest>
14#include <QObject>
15#include <QUrl>
16
20class KisRemoteFileFetcher : public QObject
21{
22 Q_OBJECT
23public:
24 explicit KisRemoteFileFetcher(QObject *parent = 0);
25 ~KisRemoteFileFetcher() override;
26
28 bool fetchFile(const QUrl &remote, QIODevice *io);
29
30 static QByteArray fetchFile(const QUrl &remote);
31
32
33private Q_SLOTS:
34 void error(QNetworkReply::NetworkError error);
35
36private:
37 QNetworkRequest *m_request;
38 QNetworkReply *m_reply;
39};
40
41#endif // KISREMOTEFILEFETCHER_H
The KisRemoteFileFetcher class can fetch a remote file and blocks until the file is downloaded.
void error(QNetworkReply::NetworkError error)
QNetworkRequest * m_request
KisRemoteFileFetcher(QObject *parent=0)
bool fetchFile(const QUrl &remote, QIODevice *io)
fetch the image. Shows a progress dialog