diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-08-13 22:48:18 +0200 |
---|---|---|
committer | bstoeger <32835590+bstoeger@users.noreply.github.com> | 2019-09-14 13:20:59 +0200 |
commit | 6a9df3bba3021b95f354c0590c79a458dbeca45b (patch) | |
tree | 68c5adc6d6bf8ab26e5bb56139c22f2913e65a0f /desktop-widgets/templatelayout.h | |
parent | 981c23070693b69a3b6a854a41cc91c8516abb95 (diff) | |
download | subsurface-6a9df3bba3021b95f354c0590c79a458dbeca45b.tar.gz |
Mobile: transform DiveObjectHelper into value-type
Instead of handing a reference-to-dive to QML, prerender all the needed
properties and store them as values in DiveObjectHelper. Exception:
- date(): generated from timestamp
- time(): generated from timestamp
- cylinderList(): does not depend on dive anyway and should be made
static.
This hopefully avoids the random mobile crashes that we are seeing.
Clearly, this code needs to be optimized, but it is a start.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/templatelayout.h')
-rw-r--r-- | desktop-widgets/templatelayout.h | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/desktop-widgets/templatelayout.h b/desktop-widgets/templatelayout.h index aea44b2b8..870cd702a 100644 --- a/desktop-widgets/templatelayout.h +++ b/desktop-widgets/templatelayout.h @@ -145,77 +145,77 @@ GRANTLEE_END_LOOKUP // exists. Remove in due course. GRANTLEE_BEGIN_LOOKUP(DiveObjectHelper) if (property == "number") { - return object.number(); + return object.number; } else if (property == "id") { - return object.id(); + return object.id; } else if (property == "rating") { - return object.rating(); + return object.rating; } else if (property == "visibility") { - return object.visibility(); + return object.visibility; } else if (property == "date") { return object.date(); } else if (property == "time") { return object.time(); } else if (property == "timestamp") { - return QVariant::fromValue(object.timestamp()); + return QVariant::fromValue(object.timestamp); } else if (property == "location") { - return object.location(); + return object.location; } else if (property == "gps") { - return object.gps(); + return object.gps; } else if (property == "gps_decimal") { - return object.gps_decimal(); + return object.gps_decimal; } else if (property == "dive_site") { - return object.dive_site(); + return object.dive_site; } else if (property == "duration") { - return object.duration(); + return object.duration; } else if (property == "noDive") { - return object.noDive(); + return object.noDive; } else if (property == "depth") { - return object.depth(); + return object.depth; } else if (property == "divemaster") { - return object.divemaster(); + return object.divemaster; } else if (property == "buddy") { - return object.buddy(); + return object.buddy; } else if (property == "airTemp") { - return object.airTemp(); + return object.airTemp; } else if (property == "waterTemp") { - return object.waterTemp(); + return object.waterTemp; } else if (property == "notes") { - return object.notes(); + return object.notes; } else if (property == "tags") { - return object.tags(); + return object.tags; } else if (property == "gas") { - return object.gas(); + return object.gas; } else if (property == "sac") { - return object.sac(); + return object.sac; } else if (property == "weightList") { - return object.weightList(); + return object.weightList; } else if (property == "weights") { - return object.weights(); + return object.weights; } else if (property == "singleWeight") { - return object.singleWeight(); + return object.singleWeight; } else if (property == "suit") { - return object.suit(); + return object.suit; } else if (property == "cylinderList") { return object.cylinderList(); } else if (property == "cylinders") { - return object.cylinders(); + return object.cylinders; } else if (property == "cylinderObjects") { - return QVariant::fromValue(object.cylinderObjects()); + return QVariant::fromValue(object.cylinderObjects); } else if (property == "maxcns") { - return object.maxcns(); + return object.maxcns; } else if (property == "otu") { - return object.otu(); + return object.otu; } else if (property == "sumWeight") { - return object.sumWeight(); + return object.sumWeight; } else if (property == "getCylinder") { - return object.getCylinder(); + return object.getCylinder; } else if (property == "startPressure") { - return object.startPressure(); + return object.startPressure; } else if (property == "endPressure") { - return object.endPressure(); + return object.endPressure; } else if (property == "firstGas") { - return object.firstGas(); + return object.firstGas; } GRANTLEE_END_LOOKUP #endif |