aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2017-12-28Planner notes: don't omit deco stops with rapid ascent ratesGravatar Rick Walsh
This fixes a bug where if the user entered very high ascent (or less commonly descent) rates such that the time to ascend (or descend) from one level to the next was less than 10s, that leg would be skipped in the dive plan notes. Reported-by: Alexander Maier <maieralex@me.com> Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-12-28cleanup: Uninitialized scalar fieldGravatar Jan Mulder
CID 45184 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-28cleanup: Uninitialized scalar fieldGravatar Jan Mulder
CID 208317 CID 208325 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-28cleanup: Logically dead codeGravatar Jan Mulder
CID 208318 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-28cleanup: Argument cannot be negativeGravatar Jan Mulder
CID 208296. IndexOf can return -1 when not found, which will not happen in this context, so just to silence Coverity. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-28cleanup: Uninitialized pointer fieldGravatar Jan Mulder
CID: 208335 Mainly to silence Coverity, as I do not believe this caused any problem. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-28cleanup: correct signature and declare externGravatar Jan Mulder
clear_vpmb_state() was declared with incorrect signature, and all functios in this change are extern, so declare them as such. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-28Cleanup: Uninitialized scalar fieldGravatar Jan Mulder
CID 208315 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-28filter: fix trip header bugGravatar Jan Mulder
With commit 5962f00679fae555, a well known problem was introduced. Incorrect width setting for the spanning trip lines. And as there is even a specific functon for that, just call this. The reason the mentioned commit introduces this, is that invalidate() causes layoutChanged signals, and invalidateFilter() does not. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-28filter: setStringList() at end of every changeGravatar Jan Mulder
This is mainly code maintenance. Instead of emitting explicit dataChanged signals, we can make sure that setStringList() is called after all model data manipulation is ready. Accoording to the Qt docs: "The model will notify any attached views that its underlying data has changed". In itself, this does not solve the tripped assert mentioned in commit 5962f00679fae5, but this calling at the end just feels better. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-28filter: prevent assert trap on exit filtersGravatar Jan Mulder
This "bug" is found using Qt 5.10 compiled in developer mode. Access the filers, click a little around here, close the filters. Almost every time the following assert is triggered: ASSERT failure in QPersistentModelIndex::~QPersistentModelIndex: "persistent model indexes corrupted", file itemmodels/qabstractitemmodel.cpp, line 643 This is relatively deep down in Qt, and it is triggered by clearing the filters. Trying to force a crash when using the same scenario in Qt 5.10 compiled for production (so no active asserts) did not result in a crash. So, upto this time, it is unclear if the Qt assert points out a real problem, or it is some false alarm (for whatever reason). Further investigation shows that the assert can be solved by changing the invalidate() to an invalidateFilter(). Indeed, the last variant is a little more lightweigt, and does seem to do the same job from a functional point of view (in this case). Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-28Replace less-or-equal by less-than comparison in lessThan functionGravatar Berthold Stoeger
DiveLocationFilterProxyModel::lessThan() used less-or-equal instead of less-than comparison. This can lead to subtle bugs if two elements compare as equal. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-28Remove unnecessary dynamic_cast<>s in filter codeGravatar Berthold Stoeger
FilterModelBase is a direct subclass of QAbstractItemModel. Therefore, dynamic_cast<>ing the former to the latter is unnecessary. Probably an artifact of previous code. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-27Cleanup: avoid dereferencing NULL pointerGravatar Dirk Hohndel
Coverity CID 208330 Coverity CID 208301 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-27Cleanup: avoid uninitialized membersGravatar Dirk Hohndel
This is basically to make Coverity happy. Coverity CID 208300 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-27Cleanup: avoid potentially uninitialized membersGravatar Dirk Hohndel
Realistically this is a false positive as we should never use a second BTDiscovery instance - but there's nothing wrong with being extra certain. Coverity CID 208319 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-27Cleanup: avoid memory leakGravatar Dirk Hohndel
Coverity CID 45078 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-27Cleanup: avoid memory leakGravatar Dirk Hohndel
Coverity CID 45121 Coverity CID 45163 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-27Cleanup: correctly prevent memory leakGravatar Dirk Hohndel
The previous attempt to fix this in commit 652e382e68 ("Cleanup: avoid a few memory leaks") was clearly bogus. Oops. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-27Check different sensors on divinglog importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-12-26Cleanup: avoid dereferencing NULL pointerGravatar Dirk Hohndel
Coverity CID 208323 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-26Cleanup: avoid accessing uninitialized variableGravatar Dirk Hohndel
Coverity CID 208289 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-26Cleanup: avoid out of bounds accessGravatar Dirk Hohndel
sizeof() is clearly the wrong way to get to the size of that array... Coverity CID 208294 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-26Cleanup: avoid out of bounds accessGravatar Dirk Hohndel
sizeof() is clearly the wrong way to get to the size of that array... Coverity CID 208290 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-26Cleanup: avoid out of bounds accessGravatar Dirk Hohndel
sizeof() is clearly the wrong way to get to the size of that array... Coverity CID 208297 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-26Cleanup: avoid memory leakGravatar Dirk Hohndel
Coverity CID 208298 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-26Cleanup: avoid memory leakGravatar Dirk Hohndel
Coverity CID 208308 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-26Cleanup: avoid memory leakGravatar Dirk Hohndel
Coverity CID 208314 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-26Cleanup: avoid memory leakGravatar Dirk Hohndel
No point in doing the strdup of the password if we then bail. Coverity CID 208316 Coverity CID 209293 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-26Cleanup: prevent out of bounds readGravatar Dirk Hohndel
Don't access cylinder[MAX_CYLINDERS] Coverity CID 208324 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-26Cleanup: avoid memory leakGravatar Dirk Hohndel
Coverity CID 208327 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-26Cleanup: avoid memory leakGravatar Dirk Hohndel
Coverity CID 208333 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-26Cleanup: avoid memory leakGravatar Dirk Hohndel
Coverity CID 208337 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-26Cleanup: prevent potential out of bounds writeGravatar Dirk Hohndel
Since we cannot store tanks / gases past MAX_CYLINDERS (currently 20), there is no point in analyzing those data. Coverity CID 208339 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-26Cleanup: avoid memory leakGravatar Dirk Hohndel
The JUMP macro includes a 'goto bail', so we need to free devdata there Coverity CID 208340 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-26Cleanup: check we have dive before dereferencingGravatar Dirk Hohndel
Coverity CID: 208341 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-26Cleanup: avoid a few memory leaksGravatar Dirk Hohndel
Coverity CID 215199 Coverity CID 215195 Coverity CID 215196 Coverity CID 215198 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-26Update CHANGELOG.md to reflect new filter featuresGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-26Introduce negate-toggle buttons to filter listsGravatar Berthold Stoeger
Introduce toggle buttons which mean "filter all dives except those fulfilling the selected criteria". The old code used to check for rowCount() == 0. This should never happen, because there is always a row "empty field". This check was moved into the preamble of the functions to seperate it from the actual logic. Fixes #435 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-26Turn filter list options into context menuGravatar Berthold Stoeger
Let the menu introduced in commit 5e86442bab680b79fbd3cd490091ab9f14252e94 pop up on right-click instead of button-click. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-26Remove Q_OBJECT macros and friend declaration from *Filter classesGravatar Berthold Stoeger
Since these classes do not possess any signals/slots, these macro are unnecessary. Likewise, the friend declaration in TagFilter is useless, since the corresponding fields are in the base class. Fallout of commit 1a4e7ad0dd29b9eeac2016933cb86bff260dadbb. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-26mobile: close GPS menu drawer when selectedGravatar Jan Mulder
This is mainly a cosmetic improvement. The GPS menu stayed visible, when selecting most of the options. This looks weird, as the close of the menu is also an indication of the selected action carried out. So, just close it Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-26Android build: make androiddeployqt less verboseGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-26Travis: try another work aroundGravatar Dirk Hohndel
The previous hack got us to see that the error was a write error to stdout and based on https://github.com/travis-ci/travis-ci/issues/4704#issuecomment-321777557 setting filter_secrets: false will work around that issue. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-26Android build: work around odd bug with cmake 3.10Gravatar Dirk Hohndel
For some reason it suddenly cannot figure out which build program to use. This seems like a weird hack, but works. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-26Android build: no point making the docsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-25CHANGELOG.mdGravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-25Use correct date formatGravatar Jan Mulder
A very very trival fix, for a mysterious issue. When loading GPS fix data from the server, the string date was parsed with the format "yyy-M-d". And no, the "yyy" is no typo here, but was the reason that data from the read from server got a 1/1/1970 data. And when a user decided to upload that data to the server again, we ended up with 2 copies of the GPS fix. One with correct data (as originally saved), and one new with the bogus date. In order to het rid of those weird 1/1/1970 GPS fixes, users will have to remove them by hand. Fixes: #567 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-25Prevent overflow in effective GF calculationGravatar Robert C. Helling
For deep dives with long deco, the sum of deco stops could overflow. This is prevent by turning it into long. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-12-24Travis: hack around Android build failuersGravatar Dirk Hohndel
For some reason accepting the licenses for the SDK appears to fail. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>