mobile: remove DiveObjectHelper code

When editing a dive, a DiveObjectHelper of the unmodified dive
was created to compare the edited with the old values. Since
the DiveObjectHelper is used here only as a pointless wrapper
around the formatting functions, call these functions directly.

However, note that the code is in principle wrong since the
change to the mobile-models, which do not use the DiveObjectHelper.
The real fix would be to reload the data from the model to prevent
going out-of-sync with respect to the formatting routines!

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-12-15 16:10:08 +01:00 committed by Dirk Hohndel
parent cc5ebd7414
commit 1037c15b98
6 changed files with 42 additions and 39 deletions

View file

@ -261,10 +261,10 @@ private:
QString m_notificationText;
qreal m_lastDevicePixelRatio;
QElapsedTimer timer;
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);
bool checkDepth(const DiveObjectHelper &myDive, struct dive *d, QString depth);
bool checkDate(struct dive *d, QString date);
bool checkLocation(DiveSiteChange &change, struct dive *d, QString location, QString gps);
bool checkDuration(struct dive *d, QString duration);
bool checkDepth(struct dive *d, QString depth);
bool currentGitLocalOnly;
bool localChanges;
QString m_progressMessage;