mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 04:53:24 +00:00
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:
parent
75765be14c
commit
26076610e5
1 changed files with 10 additions and 5 deletions
|
@ -47,12 +47,17 @@ MainWindow::MainWindow() : ui(new Ui::MainWindow())
|
||||||
struct dive *d;
|
struct dive *d;
|
||||||
qDebug("address of dive_table %p", &dive_table);
|
qDebug("address of dive_table %p", &dive_table);
|
||||||
for_each_dive(i, d) {
|
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,
|
dive = new DiveItem(d->number,
|
||||||
QDateTime::fromTime_t(d->when).toString(),
|
buffer,
|
||||||
(float)d->maxdepth.mm/1000 ,
|
(float)d->duration.seconds/60,
|
||||||
(float)d->duration.seconds/60,
|
(float)d->maxdepth.mm/1000 ,
|
||||||
d->location,
|
d->location,
|
||||||
root);
|
root);
|
||||||
|
free(buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue