summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlmanager.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-28 18:14:00 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-29 12:36:57 -0700
commitd12e86cb2b7fa5562078d0d71ffec8d8201e70d6 (patch)
tree57cee9c3eef009f4a267ef9e5b9c38164dc300c6 /mobile-widgets/qmlmanager.h
parentd482108f8c8d916a896091f8f3417d7e08278698 (diff)
downloadsubsurface-d12e86cb2b7fa5562078d0d71ffec8d8201e70d6.tar.gz
mobile/cleanup: use a mutex to protect storage access
Instead of the crude and error prone bool, let's just use the right tool for this job. In order to avoid issues with a goto across a mutex boundary, this slightly restructures the code in one place - 'git show -w' makes it clear that this is really rather simple in its changes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qmlmanager.h')
-rw-r--r--mobile-widgets/qmlmanager.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h
index f3440cf75..5765667d0 100644
--- a/mobile-widgets/qmlmanager.h
+++ b/mobile-widgets/qmlmanager.h
@@ -9,6 +9,7 @@
#include <QElapsedTimer>
#include <QColor>
#include <QFile>
+#include <QMutex>
#include "core/btdiscovery.h"
#include "core/gpslocation.h"
@@ -255,7 +256,7 @@ private:
QString m_notificationText;
qreal m_lastDevicePixelRatio;
QElapsedTimer timer;
- bool alreadySaving;
+ QMutex alreadySaving;
bool checkDate(const DiveObjectHelper &myDive, struct dive *d, QString date);
bool checkLocation(DiveSiteChange &change, const DiveObjectHelper &myDive, struct dive *d, QString location, QString gps);
bool checkDuration(const DiveObjectHelper &myDive, struct dive *d, QString duration);