The Seabear import fixed up the NDL and TTS in the samples from minutes
(in the import) to seconds (our internal format for all time). But it
did it with a loop that overran the end of the samples array by one:
for(int s_nr = 0 ; s_nr <= dive->dc.samples ; s_nr++) {
Fix it to use the proper "<" instead of "<=".
Reported-by: Stuart Vernon <stuartv@force2.net>
Tested-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This updates the got progress indicator to the changed interface where we don't
pass in an explicit percentage.
It also finally fixes an old problem: If we don't allow the Qt main loop to
process the events, we'll never see a decent progress indicator...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
A few more fixes for things that broke in commit 7be962bfc2 ("Move
subsurface-core to core and qt-mobile to mobile-widgets").
[Dirk Hohndel: slightly edited and overlap with Linus' patch removed]
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
As expected, commit 7be962bfc2 ("Move subsurface-core to core and qt-mobile
to mobile-widgets") caused some breakage.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In commit df4e26c875 ("Start sanitizing gaschange event information")
back about a year and a half ago, I started sanitizing the gas switch
event data, allowing gas switches to be associated with a particular
cylinder index rather than just the gas mix that is switched to.
But that initial step only _allowed_ a gas switch event to be associated
with a particular cylinder, the primary model was still to just specify
the mix.
This finally takes the next step, and *always* associates a gas switch
event with a particular cylinder. Instead of then looking up the
cylinder by trying to match gas mixes at runtime, subsurface now looks
it up when loading the dive initially as part of the dive fixup code.
The switch event still has an a separate gas mix associated with it, but
this patch also starts preparing for entirely relying on the gas mix in
the cylinder itself, by starting to pass in not just the event but also
the dive pointer to the routines that look up gas mix details.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
This caches the git ID for the dive on load, and avoids building the
dive directory and hashing it on save as long as nothing has invalidated
the git ID cache.
That should make it much faster to write back data to the git
repository, since the dive tree structure and the divecomputer blobs in
particular are the bulk of it (due to all the sample data). It's not
actually the git operations that are all that expensive, it's literally
generating the big blob with all the snprintf() calls for the data.
The git save used to be a fairly expensive with large data sets,
especially noticeable on mobile with much weaker CPU's. This should
speed things up by at least a factor of two.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
otherwise the max interferes with the value. Furthermore this increases
the max values a bit.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In the planner, for recreational mode, there is a setting indicating
the pressure at which the diver should be back at the surface. This
pressure was hardcoded to bar.
Fixes#1027
[Dirk Hohndel: small modifications, more reasonable step for psi,
more reasonable maxima]
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The unit for the depth parameters ain't meters, its 0.1 meters. This
caused the values stored to be out of range.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The function preprocessTemplate(), did not account well
for indexes in Grantlee variables, such as:
dive.weight# (where # is the index)
dive.cylinder#
To solve the issue the list (QList<QPair<QString, QString> >)
for variables to be replaced is populated will all possible
indexes:
0 - MAX_WEIGHTSYSTEM for weights
0 - MAX_CYLINDERS for cylinders
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The current Grantlee template loading scheme does not
allow a preprocessing layer. With the recent DiveObjectHelper
changes the layer is required if we don't want to add a set
of dummy methods and Q_PROPERTIES which will only inflate
the DiveObjectHelper class.
Use the already present helper readTemplate() to load the
raw HTML template and pass it to a static function which
does some variable replacement to accomudate DiveObjectHelper.
This change is done for the sake of not breaking the Grantlee
HTML variables on the user side!
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This attempts to detect the time format when initially importing a CSV
file. Well, only the minutes:seconds notation is detected currently.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This tries to detect the date format when initially reading a CSV file
for importing.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Cloud Storage is a non-gui based class, we currently use
two different approaches for cloud storage, one on the desktop
target and other on the mobile target, we should use only one.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
start of the QSettinsg Object Wrapper usage on the code
this first patch removes two macros that generated around
200 lines in runtime for something like a quarter of it
Basically, whenever we changed anything we called the
PreferencesDialog::settingsChanged and connected everythign
to that signal, now each setting has it's own changed signal
and we can call it directly.
The best thing about this approach is that we don't trigger
repaints for things that are not directly profile related. (
actually we still do, but the plan is to remove them in due time)
this commit breaks correct atualization of the profile (because
everything was connected to PreferencesDialog::settingsChanged)
and now I need to hunt a bit for the correct connections
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds the configure parameters for safety stops on the hwOS(OSTC3)
and OSTC computers.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The index in the fixpopup function was incorrect which caused the user to
need TWO cursor down presses to move to the second element. I changed the
index value so the user now needs only one key press to traverse up/dowm.
Fixes#954
Signed-off-by: krishan Chopra <choprakrishan61@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This hides the start time when viewing trip details.
See #964
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The date comes from the first dive in trip, thus no need to allow
editing (especially since the edited date seems to be discarded in any
case).
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
As pointed by jwhferguson, I changed "show average depth" to "show
mean depth".
I modified file preferences_graph.ui and changed the text. This bug was
reported on fedora 22. i use ubuntu.layout and justification is nicely
displayed.
The patch also removes a no longer necessary include.
See #922
Signed-off-by: krisalpha <choprakrishan61@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We forgot to delete the Grantlee object before creating a new one
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We don't need a list of QFileInfo if we are not using it
much better to have a list of the files directly
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>