From 26076610e54957bedd9f04d68000c03009c20373 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 18 Apr 2013 13:23:46 -0700 Subject: Use helper function to get dive date string Correct order of arguments in the DiveItem constructor call. Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'qt-ui/mainwindow.cpp') 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); } } } -- cgit v1.2.3-70-g09d2