By copying a line from the Linux bluetooth code I can download
from OSTC dive computers on Mac. Don't ask me why this works.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
We need to make sure the model is avaliable for the table
until it hits the destructor.
Fixes#347
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
See https://github.com/Subsurface-divelog/subsurface/issues/345. The
menues where not translated. The basis of this error is a simple
typo in core/taxonomy.c where the classname was mis-spelled in the
QT_TRANSLATE_NOOP. In addition, to pull and translate the strings
from C code, the normal tr() does not work, and the functionality
from the gettextfromc class is used.
Fixes: #345
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
See https://github.com/Subsurface-divelog/subsurface/issues/342. The reason is
that we never get a DC_EVENT_DEVINFO when doing a memory dump. Just do not
offer to update firmware when we are creating a libdc dump.
Full credits of this fix go to Anton.
Fixed-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
With current code when re-planning a dive the planner output in the
dive notes is always moved down by one line.
This fix avoids that this additional line break is added.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
The file static po2 value, used to set the setpoint data, was not re-initialized
at the parsing of a dive during import from the divecomputer. So, in one import session,
the po2 was transferred from one dive to the next, obviously resulting in weird bugs, due
to possible wrong po2 settings.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
On some divecomputers we download all the data from the device and
then parse the data afterwards just in memory (at which point the
progress bar has already run all the way to 100%). So don't try to
show the dive number and time in that case.
Fixes#335
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we run into an error during the download, stop the timer that
triggers the update to the progressbar.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This fixes an issue where beginRemoveRows is called with argument -1
in DiveImportedModel::setImportedDivesIndexes.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Curly braces are necessary in nested conditionals or results may not be
those expected. In this case, the "else" clause applied on second "if",
instead of first one.
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
I believe that even though the sample file clearly shows
comments, the syntax actually doesn't allow it.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is another attept at the problem if identifying a potentially
user supplied text in the dive notes upon replannig a dive.
It gets rid of the user visable position markers (*!* and ***) and
cirumvents problems with mark-up by first converting the old notes
to plan text (assuming that user only enters plain text in the notes
field as we do in other places as well). Then the automatically added
part is identified by locating the disclaimer in the text (if the user
edited/delted the disclaimer or changed langue in between it is her
problem to manually delete the old plan).
Everything from the disclaimer on is deleted and replaced by the new plan.
If the disclaimer is not found, the new plan is appended to the old notes.
This way we make sure no information gets automatically deleted.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Yes, currentdive can be undefined in case of of a new logbook and starting the planner
right away. Do not abort on that.
Reported-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
When replanning a dive, the setpoint information from the profile waypoints
were reset to 0, resulting in a dive that has a dive mode of CCR, but only with
OC legs in the profile. This is just wrong, and is corrected here. Notice
that there is no averaging involved (in the reduction of a replanned real
dive that has more than 100 waypoints) as is done for depth. This is just
fine for setpoint data.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Data such as cilinders and used gasses are populated fromn the currently
selected dive when starting the planner. It is more logical to use
the dive mode (OC, CCR, pSCR) of the currently selected dive
as well. This commits changes this.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2 strings in the planner output showed based on "Bühlmann ZHL-16B with GFLow = "
gradient factors without % after the factor. While this is fine for an
abbreviated form like GF 40/80, this looks strange for a verbose sentence like
the 2 corrected ones.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Currently we do not know what the extra data in the sampleBlob is, but
the block size must be adjusted nevertheless.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Setting up an RFCOMM connection has not been required for a long time.
Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Applie a more strict filter to URL handling in dive notes:
The URL needs to have:
- Scheme like "http:" or "mailto:"
- Host name like "www.test.de" or path like "/pathtosomewhere/"
Otherwise strings like "OTU:" or "Runtime:" are treated as URL.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
URLs in the dive notes are detected today. A tooltip is displayed and
one can follow the URL by Ctrl-click.
In the function fromCursorTilWhitespace there is an issue with incorrect
return value of Qt (5.7?!) function cursor->movePosition(). This value is
erroneous true in some condition e.g. if the cursor is inside a table at
the very beginning or the very end of a table line and not moving any more.
This can cause the function end up in an infinite loop.
Bugfix adds an additional exit criteria for the loop if the string is
not growing any more.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>