diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-07-11 21:39:44 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-07-11 21:39:44 -0700 |
commit | 6699dab9522420991b961d1006fa75bb6dbbfcaf (patch) | |
tree | d70c3c70a2709b5fae2ae77a17750db6814b564f /qt-ui/models.cpp | |
parent | 2552b027aea21a222b4087d5616c452a4bca1dde (diff) | |
download | subsurface-6699dab9522420991b961d1006fa75bb6dbbfcaf.tar.gz |
Printing: print tags instead of max CNS
And re-order / re-size the fields so more useful information is actually
shown.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r-- | qt-ui/models.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index 4df9c54f2..8e10452fd 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -1902,9 +1902,9 @@ QVariant ProfilePrintModel::data(const QModelIndex &index, int role) const if (col == 0) return tr("Gas used:"); if (col == 2) - return tr("SAC:"); + return tr("Tags:"); if (col == 3) - return tr("Max. CNS:"); + return tr("SAC:"); if (col == 4) return tr("Weights:"); } @@ -1932,24 +1932,27 @@ QVariant ProfilePrintModel::data(const QModelIndex &index, int role) const if (row == 3) { if (col == 0) { int added = 0; - const char *desc; - QString gases; + QString gas, gases; for (int i = 0; i < MAX_CYLINDERS; i++) { - desc = dive->cylinder[i].type.description; + gas = dive->cylinder[i].type.description; + gas += QString(!gas.isEmpty() ? " " : "") + gasname(&dive->cylinder[i].gasmix); // if has a description and if such gas is not already present - if (desc && gases.indexOf(QString(desc)) == -1) { + if (!gas.isEmpty() && gases.indexOf(gas) == -1) { if (added > 0) gases += QString(" / "); - gases += QString(desc); + gases += gas; added++; } } return gases; } - if (col == 2) - return di.displaySac(); + if (col == 2) { + char buffer[256]; + taglist_get_tagstring(dive->tag_list, buffer, 256); + return QString(buffer); + } if (col == 3) - return QString::number(dive->maxcns); + return di.displaySac(); if (col == 4) { weight_t tw = { total_weight(dive) }; return get_weight_string(tw, true); |