mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
d482108f8c
commit
d12e86cb2b
2 changed files with 43 additions and 45 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue