summaryrefslogtreecommitdiffstats
path: root/qt-ui/downloadfromdivecomputer.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-08 09:31:18 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-08 09:33:47 -0800
commitc1bc29bd4b05dafb26dbc1f94ed4070b07612f59 (patch)
treeba17e5dc91f10bac61a96198f3fee348e0413ca1 /qt-ui/downloadfromdivecomputer.cpp
parenta3ea1d51f9a52902fa44a734b98d00b5b71f83af (diff)
downloadsubsurface-c1bc29bd4b05dafb26dbc1f94ed4070b07612f59.tar.gz
Dive d/l selection UI: show useful data in a useful format
We don't get location data from the dive computer (at least not from 99.99% of the dive computers today). And we really need to show the data in a human readable format. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/downloadfromdivecomputer.cpp')
-rw-r--r--qt-ui/downloadfromdivecomputer.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp
index 730a7b8a5..94b89ef5b 100644
--- a/qt-ui/downloadfromdivecomputer.cpp
+++ b/qt-ui/downloadfromdivecomputer.cpp
@@ -512,7 +512,7 @@ DiveImportedModel::DiveImportedModel(QObject *o) : QAbstractTableModel(o),
int DiveImportedModel::columnCount(const QModelIndex& model ) const
{
- return 5;
+ return 3;
}
int DiveImportedModel::rowCount(const QModelIndex& model) const
@@ -531,11 +531,9 @@ QVariant DiveImportedModel::data(const QModelIndex& index, int role) const
struct dive* d = get_dive( index.row() + firstIndex);
if (role == Qt::DisplayRole) {
switch(index.column()){
- case 0 : return QVariant((int) d->when);
- case 1 : return QVariant(d->duration.seconds);
- case 2 : return QVariant(d->maxdepth.mm);
- case 3 : return QVariant(d->latitude.udeg);
- case 4 : return QVariant(d->longitude.udeg);
+ case 0 : return QVariant(get_short_dive_date_string(d->when));
+ case 1 : return QVariant(get_dive_duration_string(d->duration.seconds, tr("h:"), tr("min")));
+ case 2 : return QVariant(get_depth_string(d->maxdepth.mm, true, false));
}
}
if (role == Qt::CheckStateRole) {