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
@ -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…
x
Reference in New Issue
Block a user