diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-04-18 13:23:46 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-04-18 13:23:46 -0700 |
commit | 26076610e54957bedd9f04d68000c03009c20373 (patch) | |
tree | 185ede5ac3a39a51ad2d63a0ceb929ce66cf5e18 /qt-ui | |
parent | 75765be14cc90886d7f46ec02097b7efeb3d8234 (diff) | |
download | subsurface-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.cpp | 15 |
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); } } } |