aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-04-18 13:23:46 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-04-18 13:23:46 -0700
commit26076610e54957bedd9f04d68000c03009c20373 (patch)
tree185ede5ac3a39a51ad2d63a0ceb929ce66cf5e18 /qt-ui
parent75765be14cc90886d7f46ec02097b7efeb3d8234 (diff)
downloadsubsurface-26076610e54957bedd9f04d68000c03009c20373.tar.gz
Use helper function to get dive date string
Correct order of arguments in the DiveItem constructor call. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/mainwindow.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index de7bb5460..551c28faa 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -47,12 +47,17 @@ MainWindow::MainWindow() : ui(new Ui::MainWindow())
struct dive *d;
qDebug("address of dive_table %p", &dive_table);
for_each_dive(i, d) {
+ struct tm tm;
+ char *buffer;
+ utc_mkdate(d->when, &tm);
+ buffer = get_dive_date_string(&tm);
dive = new DiveItem(d->number,
- QDateTime::fromTime_t(d->when).toString(),
- (float)d->maxdepth.mm/1000 ,
- (float)d->duration.seconds/60,
- d->location,
- root);
+ buffer,
+ (float)d->duration.seconds/60,
+ (float)d->maxdepth.mm/1000 ,
+ d->location,
+ root);
+ free(buffer);
}
}
}