2019-12-08 10:45:55 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#ifndef UPLOADDIVESHARE_H
|
|
|
|
#define UPLOADDIVESHARE_H
|
|
|
|
#include <QNetworkReply>
|
|
|
|
#include <QTimer>
|
|
|
|
|
|
|
|
class uploadDiveShare : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
static uploadDiveShare *instance();
|
|
|
|
void doUpload(bool selected, const QString &uid, bool noPublic);
|
|
|
|
|
|
|
|
private slots:
|
2019-12-12 11:39:29 +00:00
|
|
|
void updateProgressSlot(qint64 current, qint64 total);
|
|
|
|
void uploadFinishedSlot();
|
|
|
|
void uploadTimeoutSlot();
|
|
|
|
void uploadErrorSlot(QNetworkReply::NetworkError error);
|
2019-12-08 10:45:55 +00:00
|
|
|
|
|
|
|
signals:
|
2019-12-10 14:45:51 +00:00
|
|
|
void uploadFinish(bool success, const QString &text, const QByteArray &html);
|
2019-12-08 10:45:55 +00:00
|
|
|
void uploadProgress(qreal percentage, qreal total);
|
|
|
|
void uploadStatus(const QString &text);
|
|
|
|
|
|
|
|
private:
|
|
|
|
uploadDiveShare();
|
|
|
|
|
|
|
|
QNetworkReply *reply;
|
|
|
|
QTimer timeout;
|
|
|
|
};
|
2024-05-04 15:55:50 +00:00
|
|
|
|
2019-12-08 10:45:55 +00:00
|
|
|
#endif // UPLOADDIVESHARE_H
|