Having subsurface-core as a directory name really messes with
autocomplete and is obviously redundant. Simmilarly, qt-mobile caused an
autocomplete conflict and also was inconsistent with the desktop-widget
name for the directory containing the "other" UI.
And while cleaning up the resulting change in the path name for include
files, I decided to clean up those even more to make them consistent
overall.
This could have been handled in more commits, but since this requires a
make clean before the build, it seemed more sensible to do it all in one.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
"weights" and "cylinders" are QStringList Q_PROPERTIES, and Grantlee
should be able to render them, but it doesn't.
To be able to print the whole list of weights and cylinders we
introduce two new QString properties "weightList" and "cylinderList".
The variable replacement in the previous patch deals with the
conversation of the user side HTML, e.g.:
USER -> INTERNAL
"{{ dive.weights }} -> {{ dive.weightList }}"
"{{ dive.cylinders }} -> {{ dive.cylinderList }}"
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We had two totally different usage cases for "get_volume_string()": one
that did the obvious "show this volume as a string", and one that tried
to show a cylinder size.
The function used a magic third argument (the working pressure of the
cylinder) to distinguish between the two cases, but it still got it
wrong.
A metric cylinder doesn't necessarily have a working pressure at all,
and the size is a wet size in liters. We'd pass in zero as the working
pressure, and if the volume units were set to cubic feet, the logic in
"get_volume_string()" would happily convert the metric wet size into the
wet size in cubic feet.
But that's completely wrong. An imperial cylinder size simply isn't a
wet size. If you don't have a working pressure, you cannot convert the
cylinder size to cubic feet. End of story.
So instead of having "get_volume_string()" have magical behavior
depending on working pressure, and getting it wrong anyway, just make
get_volume_string do a pure volume conversion, and create a whole new
function for showing the size of a cylinder.
Now, if the cylinder doesn't have a working pressure, we just show the
metric size, even if the user had asked for cubic feet.
[Dirk Hohndel: added call to translation functions for the units]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Right now this just tests for zero duration, but maybe this should also
return true for positive duration and max depth of 0.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If cylinder does not have start and end pressures assigned, attempt to
grab them from the samples instead.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It is better to use the proper function to test if cylinder is in use
than just checking the description.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since we only show the first cylinder we can also only edit the first cylinder.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
As per Tomaz recomendation the helper functions from 19588ce and e072596
are moved from qmlmanager to DiveObjectsHelper.
[Dirk Hohndel: merged with the latest code]
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The way sectioning of the dive list works is by watching for different strings
in the section.property. In order to be able to tell different trips apart we
combine the address of the dive trip variable with the location (which will
create a new section for a new trip, even if the location text is the same) and
then strip that information out before showing the trip header.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This finishes the first round of Simplication patches for the QML
basecode. The second one will be about the preferences.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
And also use existing helper function to get the GPS string
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I didn't understood the logic of the define & replace,
so maybe we want a few comments there.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The connection between the C++ core and the QML code leaves a lot of room
for improvement; the following series will do small but important updates
on the code regarding QML and QtWidget coexistence and behavior.
First: simplify wrapper class, removing uneeded variable.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
and rename it to DiveObjectHelper, since it should be an QObject
based class to make it easier on the QML, grantlee and widgets
side to display the dive's internal data.
each Q_PROPERTY defined in the DiveObjectHelper.h file
can be acessed directly via it's name.
So, if you are on a model that returns a dive, acess it's name
by dive.name
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>