From cb252f39d7acfff5585a971f5af4f9cd0f758fff Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Tue, 10 Dec 2019 09:39:45 +0100 Subject: core: corrected timeout and error text problem in uploadDiveLogsDE incorrectly stopped timer before the upload was started. Signed-off-by: Jan Iversen --- core/uploadDiveLogsDE.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/uploadDiveLogsDE.cpp b/core/uploadDiveLogsDE.cpp index 5e614d168..b4b50a7ba 100644 --- a/core/uploadDiveLogsDE.cpp +++ b/core/uploadDiveLogsDE.cpp @@ -37,10 +37,12 @@ void uploadDiveLogsDE::doUpload(bool selected, const QString &userid, const QStr { QString err; + /* generate a temporary filename and create/open that file with zip_open */ QString filename(QDir::tempPath() + "/divelogsde-upload.dld"); // delete file if it exist + QFile f(filename); if (f.open(QIODevice::ReadOnly)) { f.close(); @@ -49,15 +51,13 @@ void uploadDiveLogsDE::doUpload(bool selected, const QString &userid, const QStr // Make zip file, with all dives, in divelogs.de format if (!prepareDives(filename, selected)) { - report_error(tr("Failed to create upload file %s\n").toUtf8(), qPrintable(filename)); - emit uploadFinish(false, err); + emit uploadFinish(false, tr("Cannot prepare dives, none selected?")); timeout.stop(); return; } // And upload it uploadDives(filename, userid, password); - timeout.stop(); } -- cgit v1.2.3-70-g09d2