Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4054a19ffb | ||
|
|
54026edf7a | ||
|
|
a64787f70d |
@ -554,6 +554,8 @@ int parse_txt_file(const char *filename, const char *csv, struct dive_table *tab
|
|||||||
cyl.type.description = "3l Mk6";
|
cyl.type.description = "3l Mk6";
|
||||||
cyl.gasmix.o2.permille = 1000;
|
cyl.gasmix.o2.permille = 1000;
|
||||||
cyl.manually_added = true;
|
cyl.manually_added = true;
|
||||||
|
cyl.bestmix_o2 = 0;
|
||||||
|
cyl.bestmix_he = 0;
|
||||||
add_cloned_cylinder(&dive->cylinders, cyl);
|
add_cloned_cylinder(&dive->cylinders, cyl);
|
||||||
|
|
||||||
cyl.cylinder_use = DILUENT;
|
cyl.cylinder_use = DILUENT;
|
||||||
|
|||||||
@ -74,10 +74,12 @@ bool is_trip_before_after(const struct dive *dive, bool before)
|
|||||||
{
|
{
|
||||||
int idx = get_idx_by_uniq_id(dive->id);
|
int idx = get_idx_by_uniq_id(dive->id);
|
||||||
if (before) {
|
if (before) {
|
||||||
if (idx > 0 && get_dive(idx - 1)->divetrip)
|
const struct dive *d = get_dive(idx - 1);
|
||||||
|
if (d && d->divetrip)
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
if (idx < dive_table.nr - 1 && get_dive(idx + 1)->divetrip)
|
const struct dive *d = get_dive(idx + 1);
|
||||||
|
if (d && d->divetrip)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -716,6 +716,8 @@ void DiveTripModelTree::populate()
|
|||||||
uiNotification(QObject::tr("start processing"));
|
uiNotification(QObject::tr("start processing"));
|
||||||
for (int i = 0; i < dive_table.nr; ++i) {
|
for (int i = 0; i < dive_table.nr; ++i) {
|
||||||
dive *d = get_dive(i);
|
dive *d = get_dive(i);
|
||||||
|
if (!d) // should never happen
|
||||||
|
continue;
|
||||||
update_cylinder_related_info(d);
|
update_cylinder_related_info(d);
|
||||||
if (d->hidden_by_filter)
|
if (d->hidden_by_filter)
|
||||||
continue;
|
continue;
|
||||||
@ -1482,7 +1484,7 @@ void DiveTripModelList::populate()
|
|||||||
items.reserve(dive_table.nr);
|
items.reserve(dive_table.nr);
|
||||||
for (int i = 0; i < dive_table.nr; ++i) {
|
for (int i = 0; i < dive_table.nr; ++i) {
|
||||||
dive *d = get_dive(i);
|
dive *d = get_dive(i);
|
||||||
if (d->hidden_by_filter)
|
if (!d || d->hidden_by_filter)
|
||||||
continue;
|
continue;
|
||||||
items.push_back(d);
|
items.push_back(d);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user