summaryrefslogtreecommitdiffstats
path: root/core/uploadDiveShare.h
blob: fdd941e677868fe3f9d8e67d49923b63d84ae015 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// 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:
	void updateProgressSlot(qint64 current, qint64 total);
	void uploadFinishedSlot();
	void uploadTimeoutSlot();
	void uploadErrorSlot(QNetworkReply::NetworkError error);

signals:
	void uploadFinish(bool success, const QString &text, const QByteArray &html);
	void uploadProgress(qreal percentage, qreal total);
	void uploadStatus(const QString &text);
	
private:
	uploadDiveShare();

	QNetworkReply *reply;
	QTimer timeout;
};
#endif // UPLOADDIVESHARE_H