mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +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
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
}
|
}
|
||||||
MobileComponents.Label {
|
MobileComponents.Label {
|
||||||
text: when
|
text: date
|
||||||
width: Math.max(parent.width / 5, paintedWidth) // helps vertical alignment throughout listview
|
width: Math.max(parent.width / 5, paintedWidth) // helps vertical alignment throughout listview
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,8 @@ QVariant GpsListModel::data(const QModelIndex &index, int role) const
|
||||||
|
|
||||||
if (role == GpsDateRole)
|
if (role == GpsDateRole)
|
||||||
return get_short_dive_date_string(gt.when);
|
return get_short_dive_date_string(gt.when);
|
||||||
|
else if (role == GpsWhenRole)
|
||||||
|
return gt.when;
|
||||||
else if (role == GpsNameRole)
|
else if (role == GpsNameRole)
|
||||||
return gt.name;
|
return gt.name;
|
||||||
else if (role == GpsLatitudeRole)
|
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> GpsListModel::roleNames() const
|
||||||
{
|
{
|
||||||
QHash<int, QByteArray> roles;
|
QHash<int, QByteArray> roles;
|
||||||
roles[GpsDateRole] = "when";
|
roles[GpsDateRole] = "date";
|
||||||
|
roles[GpsWhenRole] = "when";
|
||||||
roles[GpsNameRole] = "name";
|
roles[GpsNameRole] = "name";
|
||||||
roles[GpsLatitudeRole] = "latitude";
|
roles[GpsLatitudeRole] = "latitude";
|
||||||
roles[GpsLongitudeRole] = "longitude";
|
roles[GpsLongitudeRole] = "longitude";
|
||||||
|
|
|
@ -14,7 +14,8 @@ public:
|
||||||
GpsDateRole = Qt::UserRole + 1,
|
GpsDateRole = Qt::UserRole + 1,
|
||||||
GpsNameRole,
|
GpsNameRole,
|
||||||
GpsLatitudeRole,
|
GpsLatitudeRole,
|
||||||
GpsLongitudeRole
|
GpsLongitudeRole,
|
||||||
|
GpsWhenRole
|
||||||
};
|
};
|
||||||
|
|
||||||
static GpsListModel *instance();
|
static GpsListModel *instance();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue