summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-11-30 17:09:10 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-11-30 17:12:08 +0200
commitd439d381ca59a63dc036409cfe1d157b916cb995 (patch)
tree2c8738fff3307124daec7dbb992a4d6c24f20e0e /qt-ui
parent156815f041da70d6b748abb4ddcaeab40f2a8912 (diff)
downloadsubsurface-d439d381ca59a63dc036409cfe1d157b916cb995.tar.gz
Print: update the values for DM, buddy, suit, etc
We update the values for divemaster, buddy and etc... Rating and visibility are currently displayed as "x / 5" values. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/models.cpp79
1 files changed, 12 insertions, 67 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index b8b9e2014..81bdc22a3 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -1665,74 +1665,19 @@ QVariant ProfilePrintModel::data(const QModelIndex &index, int role) const
return get_weight_string(tw, true);
}
}
- /*
- // cylinder data
- if (row > 2 && row < 10 && row - 3 < MAX_CYLINDERS) {
- cylinder_t *cyl = &dive->cylinder[row - 3];
- if (cyl->type.description) { // how do we check if a cylinder is added?
- if (col == 0) {
- if (cyl->type.description[0] != '\0')
- return QString(cyl->type.description);
- return unknown;
- }
- if (col == 1) {
- get_gas_string(cyl->gasmix.o2.permille, cyl->gasmix.he.permille, buf, sizeof(buf));
- return QString(buf);
- }
- if (col == 2) {
- return get_cylinder_used_gas_string(cyl, true);
- }
- }
- }
- // dive notes
- if (row == 10 && col == 0)
- return QString(dive->notes);
- // sac, cns, otu - headings
- if (col == 3) {
- if (row == 2)
- return tr("SAC");
- if (row == 4)
- return tr("Max. CNS");
- if (row == 6)
- return tr("OTU");
- }
- // sac, cns, otu - data
- if (col == 4) {
- if (row == 2)
- return di.displaySac();
- if (row == 4)
- return QString::number(dive->maxcns);
- if (row == 6)
- return QString::number(dive->otu);
- }
- // weights heading
- if (row == 2 && col == 5)
- return tr("Weights");
- // total weight
- if (row == 9) {
- weight_t tw = { total_weight(dive) };
- if (tw.grams) {
- if (col == 5)
- return tr("Total weight");
- if (col == 6)
- return get_weight_string(tw, true);
- }
- }
- // weight data
- if (row > 2 && row < 10 && row - 3 < MAX_WEIGHTSYSTEMS) {
- weightsystem_t *ws = &dive->weightsystem[row - 3];
- if (ws->weight.grams) {
- if (col == 5) {
- if (ws->description && ws->description[0] != '\0')
- return QString(ws->description);
- return unknown;
- }
- if (col == 6) {
- return get_weight_string(ws->weight, true);
- }
- }
+ // values for DM, buddy, suit, etc...
+ if (row == 5) {
+ if (col == 0)
+ return QString(dive->divemaster);
+ if (col == 1)
+ return QString(dive->buddy);
+ if (col == 2)
+ return QString(dive->suit);
+ if (col == 3)
+ return (dive->visibility) ? QString::number(dive->visibility).append(" / 5") : QString();
+ if (col == 4)
+ return (dive->rating) ? QString::number(dive->rating).append(" / 5") : QString();
}
- */
return QString();
}
case Qt::FontRole: {