mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
cc5ebd7414
commit
1037c15b98
6 changed files with 42 additions and 39 deletions
|
@ -250,3 +250,10 @@ QString formatDiveTime(const dive *d)
|
|||
QDateTime localTime = timestampToDateTime(d->when);
|
||||
return localTime.time().toString(prefs.time_format);
|
||||
}
|
||||
|
||||
QString formatDiveDateTime(const dive *d)
|
||||
{
|
||||
QDateTime localTime = timestampToDateTime(d->when);
|
||||
return QStringLiteral("%1 %2").arg(localTime.date().toString(prefs.date_format_short),
|
||||
localTime.time().toString(prefs.time_format));
|
||||
}
|
||||
|
|
|
@ -24,5 +24,6 @@ QString formatDiveDuration(const dive *d);
|
|||
QString formatDiveGPS(const dive *d);
|
||||
QString formatDiveDate(const dive *d);
|
||||
QString formatDiveTime(const dive *d);
|
||||
QString formatDiveDateTime(const dive *d);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -96,6 +96,4 @@ public:
|
|||
QString waterType;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(DiveObjectHelper)
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue