mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: add upload divelogs.de class
The implementation is based on class DivelogsDeWebServices in desktop-widgets but without the UI entanglement Signed-off-by: Jan Iversen <jan@casacondor.com>
This commit is contained in:
parent
42939ab7f8
commit
eb08f17a03
3 changed files with 358 additions and 0 deletions
36
core/uploadDiveLogsDE.h
Normal file
36
core/uploadDiveLogsDE.h
Normal file
|
@ -0,0 +1,36 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
#ifndef UPLOADDIVELOGSDE_H
|
||||
#define UPLOADDIVELOGSDE_H
|
||||
#include <QNetworkReply>
|
||||
#include <QHttpMultiPart>
|
||||
#include <QTimer>
|
||||
|
||||
|
||||
class uploadDiveLogsDE : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static uploadDiveLogsDE *instance();
|
||||
void doUpload(bool selected, const QString &userid, const QString &password);
|
||||
|
||||
private slots:
|
||||
void updateProgress(qint64 current, qint64 total);
|
||||
void uploadFinished();
|
||||
void uploadTimeout();
|
||||
void uploadError(QNetworkReply::NetworkError error);
|
||||
|
||||
signals:
|
||||
void uploadFinish(bool success, const QString &text);
|
||||
void uploadProgress(qreal percentage);
|
||||
|
||||
private:
|
||||
uploadDiveLogsDE();
|
||||
|
||||
bool prepareDives(bool selected, const QString &filename);
|
||||
void uploadDives(const QString &filename, const QString &userid, const QString &password);
|
||||
|
||||
QNetworkReply *reply;
|
||||
QHttpMultiPart *multipart;
|
||||
QTimer timeout;
|
||||
};
|
||||
#endif // UPLOADDIVELOGSDE_H
|
Loading…
Add table
Add a link
Reference in a new issue