export: clean up temp file after divelogs.de upload

This adds a cleanup function to be called after a divelogs.de upload
finishes (successful or not) to make sure the temporary zip file is
closed and removed.

Signed-off-by: Richard Fuchs <dfx@dfx.at>
This commit is contained in:
Richard Fuchs 2021-08-03 14:04:52 -04:00 committed by Dirk Hohndel
parent cf78e4cb20
commit f308a6b57b
2 changed files with 20 additions and 6 deletions

View file

@ -4,6 +4,7 @@
#include <QNetworkReply>
#include <QHttpMultiPart>
#include <QTimer>
#include <QFile>
class uploadDiveLogsDE : public QObject {
@ -28,10 +29,12 @@ private:
uploadDiveLogsDE();
void uploadDives(const QString &filename, const QString &userid, const QString &password);
void cleanupTempFile();
// only to be used in desktop-widgets::subsurfacewebservices
bool prepareDives(const QString &tempfile, bool selected);
QFile tempFile;
QNetworkReply *reply;
QHttpMultiPart *multipart;
QTimer timeout;