diff options
author | jan Iversen <jan@casacondor.com> | 2019-12-08 11:45:55 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-12-11 11:08:51 -0500 |
commit | e8e425edd8c92f4233c578981924c8cde832aba4 (patch) | |
tree | baeb6a03bc8e8b800d0e5335eb82671fdb6ca321 /core/uploadDiveShare.h | |
parent | 7e12ac262b35bcab05bc4a7e69d8572cba5b7ef1 (diff) | |
download | subsurface-e8e425edd8c92f4233c578981924c8cde832aba4.tar.gz |
core: add upload dive-share.com class
This is the framework that mobileExecutable needs, all
prepared to move functionality from desktop-widgets
(current implementation) into a shared version.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Diffstat (limited to 'core/uploadDiveShare.h')
-rw-r--r-- | core/uploadDiveShare.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/core/uploadDiveShare.h b/core/uploadDiveShare.h new file mode 100644 index 000000000..6aca214a5 --- /dev/null +++ b/core/uploadDiveShare.h @@ -0,0 +1,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 slot_updateProgress(qint64 current, qint64 total); + void slot_uploadFinished(); + void slot_uploadTimeout(); + void slot_uploadError(QNetworkReply::NetworkError error); + +signals: + void uploadFinish(bool success, const QString &text); + void uploadProgress(qreal percentage, qreal total); + void uploadStatus(const QString &text); + +private: + uploadDiveShare(); + + QNetworkReply *reply; + QTimer timeout; +}; +#endif // UPLOADDIVESHARE_H |