Print: update printing for gas, CNS, SAC and weights

Following the new layout for the profile print, we separate
the used gas like so:
AL80 / EAN33 / ...

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
Lubomir I. Ivanov 2013-11-30 16:51:28 +02:00
parent 35f1f716a5
commit 156815f041

View file

@ -1638,6 +1638,33 @@ QVariant ProfilePrintModel::data(const QModelIndex &index, int role) const
if (col == 4)
return tr("Rating:");
}
// values for gas, sac, etc...
if (row == 3) {
if (col == 0) {
int added = 0;
const char *desc;
QString gases;
for (int i = 0; i < MAX_CYLINDERS; i++) {
desc = dive->cylinder[i].type.description;
// if has a description and if such gas is not already present
if (desc && gases.indexOf(QString(desc)) == -1) {
if (added > 0)
gases += QString(" / ");
gases += QString(desc);
added++;
}
}
return gases;
}
if (col == 2)
return QString::number(dive->maxcns);
if (col == 3)
return di.displaySac();
if (col == 4) {
weight_t tw = { total_weight(dive) };
return get_weight_string(tw, true);
}
}
/*
// cylinder data
if (row > 2 && row < 10 && row - 3 < MAX_CYLINDERS) {