summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
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>
2017-12-24Android build: reorder downloading Qt vs SDKGravatar Dirk Hohndel
Since it's the SDK where things are failing, doing it this way makes the turnaround time of my attempts to fix this faster. And in the larger scheme of things, the order is irrelevant. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-24Fix build for cmake before 3.10Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-24Update translation source stringsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-24Update CHANGELOGGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-24Silence cmake 3.10 warningsGravatar Dirk Hohndel
Explicitly turning of automoc and friends for every single auto generated file seems a rather dumb approach... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-24mapwidget: QtQuick really to 2.5Gravatar Jan Mulder
It shall match the Qt version ... according to Dirk. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-24Remove superfluous QScopedPointer<>s in singletonsGravatar Berthold Stoeger
There was a curious pattern of singletons being implemented based on QScopedPointer<>s. This is an unnecessary level of indirection: The lifetime of the smart pointer is the same as that of the pointed-to object. Therefore, replace these pointers by the respective objects. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-24mapwidget: revert QtQuick version to 2.0Gravatar Jan Mulder
In commit f3d978b8a5fb6 the QtQuick version was upgraded to 2.6 (from 2.0 for the mapwidget). This is, apparently, too agressive, as there are still mainstream distributions that are still on Qt 5.5.1 for which 2.6 of QtQuick is too new. And as a sidenote: Qt 5.5.1 was released in October 2015. So partially revert commit f3d978b8a5fb6. Fixes: #978 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-24Small whitespace updatesGravatar Dirk Hohndel
We aren't really consistent. And I don't do this often enough. But based on a few things that I saw in a recent commit, I wanted to at least fix those. And then of course fixed everything in those two files. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-24Re-add newlines to help messageGravatar Berthold Stoeger
The two final newlines in the help message were removed in commit 0c74f7a2c8e0af7ac006c16fc9ef05e5f9245518. Re-add them. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-24beginInsertRows requires last >= firstGravatar Jan Mulder
Found while compiled against Qt 5.10 build from source. The assert Q_ASSERT(last >= first) is trapped by this beginInsertRows in case there are no pictures. Just do not call this when there are no pictures. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-24Add select-all, deselect-all and invert-selection options to filtersGravatar Berthold Stoeger
To every filter list add a menu button that allows selection of all, selection of none or inversion of selection. Implements #435. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-24Move *FilterModel functions into base classGravatar Berthold Stoeger
The *FilterModels had a number of of virtual functions, which only accessed members of the base class. Moreover, these functions were identical and generated with macros. Therefore, move these functions to the base class. The one excption is data(), which uses different count functions (passed as a macro parameter). Thus, introduce a virtual countDives() function and likewise move data() to the base class. A function pointer might be even more clear, but since the rest of the code/Qt relies heavily on runtime polymorphism, let's do the same here. The only macros left are those creating the singleton accessors. This could be more clearly realized by templates, but let's likewise keep it the way is. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-24Fold MultiFilterInterface into FilterModelBaseGravatar Berthold Stoeger
There were two classes, MultiFilterInterface and FiterModelBase. The latter derives from the former and from QStringListModel. The former was not used anywhere else. Moreover, in contradiction to its name, MultiFilterInterface is not an interface (in the Java sense), because it actually has (non-virtual) data members. All in all, the data model is very weird. Merge these two classes, since there seems to be no gain whatsoever from keeping MultiFilterInterface separate. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-24Factor out *Filter code into FilterBase base classGravatar Berthold Stoeger
The TagFilter, BuddyFilter, SuitFilter and LocationFilter classes all did essentially the same thing. Therefore, factor out common code / objects into a base class FilterBase. The new base class stores a pointer to the filter model. It was felt that this is simpler than introducing virtual methods. The only thing the *Filter classes now do is setting a label and in one case a tooltip. Thus, in principle, they could be removed completely, but let's keep them for now. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-24Use function emitDataChanged in diveplannermodel consistentlyGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-24Code cleanup: Indentation mistake plus simplificationGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-24Simplify update of gflow and gfhigh values in the codeGravatar Stefan Fuchs
The more complex handling is no longer needed because: - Keyboard tracking for gfhigh/low UI fields was switched off here: 030c094854aeab4aaade523d7126728d9ce98a5b - GFhigh was limited to 40 here: 53fffe0ce3696de33ce4657e20d295e4a43e0fd9 Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-24Remove obsolete declaration of void gfLowAtMaxDepthChangedGravatar Stefan Fuchs
in ./core/subsurface-qt/SettingsObjectWrapper.h Code for this was removed here: 5b080beddef3e08b86eb53448e737b4867a50c1a Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-24Correcty typo ghflow -> gflow in diveplannermodel.cppGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-23cleanup: remove unused includeGravatar Jan Mulder
And why this one? Well, while this include is renamed in Qt 5.10 and gives deprecated compile warnings. And as it unused anyway, just remove it. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-21Fix BuddyFilterModelGravatar Berthold Stoeger
Commit 6343515fedbc43be4fd2cb3f1b3fea384e362c59 introduced equality instead of substring comparison for filters. This broke the buddy filter in the case of more than one buddy, because in such a case the buddy list is a comma-separated string. Fix this by splitting the buddy string, trimming the individual strings and search in the list. Fixes #969 Reported-by: <yrevawerd@gmail.com> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-21cleanup: remove empty functionGravatar Jan Mulder
subsurface_OS_pref_setup() is not not used. Remove it. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-21Make QMap<> access in deleteGpsFix() more idiomaticGravatar Berthold Stoeger
To access a QMap<> entry, the value() function is used with a sentinel as default value. If the sentinel is returned, the code assumes that the searched for entry doesn't exist. Make this code more idiomatic by using an iterator and testing for end(). This fixes a compiler warning, because only one of the elements of the sentinel was initialized, but the remaining elements were copied. Harmless, because the code would exit early if it found the sentinel. Still not nice. While redoing this function, the entry-not-found message was improved (adding of function name, space between massage and timestamp) and elevated from debug to warning level. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-21Handle plot_info->nr <= 0 gracefullyGravatar Berthold Stoeger
plot_info->nr should always be > 0. If this is not the case, write a message to stderr instead of crashing in add_plot_pressure(). This silences an use-of-uninitialized-variable warning. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-21Fix use of uninitialized variable in core/profile.cGravatar Berthold Stoeger
last_ceiling was used before initialization in the first iteration of the loop in calculate_deco_information(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-21Check return of fread() in core/ostctools.cGravatar Berthold Stoeger
Since the corresponding error message appears thrice, it is translated once at the beginning of the function (even in the non-error case). A single-byte fread() was transformed into getc(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>