subsurface/mobile-widgets
Berthold Stoeger 68414531ad Mobile: don't format trip heading for all dives
QML's ListView uses the "section" property to test if items belong to the
same section. Apparently, this must be a string and therefore we can't
pass e.g. a dive-trip object. Therefore a specially formatted string
was passed in, which was guaranteed to be unique (contained the dive-trip
pointer value) and the fully formatted trip-title and short-date.

The disadvantage of that approach is that the formatting is performed for
every dive and not every trip. Perhaps not a problem now, but it makes
it for example necessary to cache the number of filtered dives.

To be more flexible, pass in only the pointer value formatted as
hexadecimal string and provide a function to convert that string
back to a trip-pointer (in the form of a QVariant, so that it can
be passed to QML). Moreover provide two functions for formatting the
title and the short-date.

The three new functions are members of DiveListSortModel. This might not
be the perfect place, but it is easy to reach from the DiveListView.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-11-23 13:22:24 -08:00
..
qml Mobile: don't format trip heading for all dives 2018-11-23 13:22:24 -08:00
qmlmanager.cpp Core: replace tripflag by notrip boolean 2018-11-20 08:14:54 -08:00
qmlmanager.h Verify that copy is done 2018-11-18 06:31:44 +08:00
qmlprefs.cpp Mobile: set units system in "No cloud mode" 2018-09-19 14:41:11 -07:00
qmlprefs.h mobile-widgets: replace qmlprefs::theme with qPrefDisplay::theme 2018-09-12 20:18:32 -07:00