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>
This commit is contained in:
Dirk Hohndel 2013-04-18 13:23:46 -07:00
parent 75765be14c
commit 26076610e5

View file

@ -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);
}
}
}