mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-17 21:06:17 +00:00
Gps list: include the time_t timestamp in the model
Just having the string means we lost the unique value that we can use as key to indentify a specific GPS fix. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b34a507d51
commit
249a2c2c09
3 changed files with 7 additions and 3 deletions
|
@ -52,7 +52,7 @@ MobileComponents.Page {
|
|||
font.pointSize: subsurfaceTheme.smallPointSize
|
||||
}
|
||||
MobileComponents.Label {
|
||||
text: when
|
||||
text: date
|
||||
width: Math.max(parent.width / 5, paintedWidth) // helps vertical alignment throughout listview
|
||||
font.pointSize: subsurfaceTheme.smallPointSize
|
||||
}
|
||||
|
|
|
@ -46,6 +46,8 @@ QVariant GpsListModel::data(const QModelIndex &index, int role) const
|
|||
|
||||
if (role == GpsDateRole)
|
||||
return get_short_dive_date_string(gt.when);
|
||||
else if (role == GpsWhenRole)
|
||||
return gt.when;
|
||||
else if (role == GpsNameRole)
|
||||
return gt.name;
|
||||
else if (role == GpsLatitudeRole)
|
||||
|
@ -58,7 +60,8 @@ QVariant GpsListModel::data(const QModelIndex &index, int role) const
|
|||
QHash<int, QByteArray> GpsListModel::roleNames() const
|
||||
{
|
||||
QHash<int, QByteArray> roles;
|
||||
roles[GpsDateRole] = "when";
|
||||
roles[GpsDateRole] = "date";
|
||||
roles[GpsWhenRole] = "when";
|
||||
roles[GpsNameRole] = "name";
|
||||
roles[GpsLatitudeRole] = "latitude";
|
||||
roles[GpsLongitudeRole] = "longitude";
|
||||
|
|
|
@ -14,7 +14,8 @@ public:
|
|||
GpsDateRole = Qt::UserRole + 1,
|
||||
GpsNameRole,
|
||||
GpsLatitudeRole,
|
||||
GpsLongitudeRole
|
||||
GpsLongitudeRole,
|
||||
GpsWhenRole
|
||||
};
|
||||
|
||||
static GpsListModel *instance();
|
||||
|
|
Loading…
Add table
Reference in a new issue