summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
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>
2017-12-21Fix order of initilization list in MainTab constructor.Gravatar Berthold Stoeger
Besides being the right thing to do (code reflects reality), it silences a compiler warning. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-20core: ignore erroneous quotes as wellGravatar Jan Mulder
A small redo of 78bafe8f620a066. The quotes cause the original functionality not to work. Ignore them as well. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-20core: fix commit 46004c39e266fe7 for real (erroneous quotes)Gravatar Jan Mulder
Unfortunately, in my commit 48d9c8eb6eb07a, I fixed only half of the problems related to the functionality introduced by Stefan in commit 46004c39e266fe7. The lonely m (that was fixed) caused a parsing error, but forgotten where the single quotes around the depth value. These quotes simply causes the new functionality not to work. Again, the fix is simple: do not erroneously save quotes. And as the new functionality is pretty obscure (replanning a non-planned dive, and manually entering a gas switch depth), another bug that could go unnoticed for years. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-19CHANGELOG.mdGravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-19git storage: invalidate cache on merge dive siteGravatar Jan Mulder
In hindsight a very simple bug to fix, but it requires some knowledge on the inner workings of our git storage. The changes on merge of dive sites were simply not saved (completely) because the git storage code has a cache that we need to invalidate selectively (ie. for the dive we just gave a new dive site uuid) to get things finally embedded in the overall commit. The main reason this bug went unnoticed for more than 2 years is that most people use the XML/SSRF format (where this problem is non exsistent), and dive site merging is probably not a very much used feature either. Fixes: #939 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-18ChangelogGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-18Update CHANGELOG.mdGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-18Implement different zoom levels for dive photos tabGravatar Berthold Stoeger
This implements different zoom levels for the dive photos tab as suggested by Stefan Fuchs <sfuchs@gmx.de> in #898. The zoom level can be changed using a slider or CTRL+mousewheel. Zoom levels range from a third of the standard thumbnail size to thrice the standard thumbnail size. Thumbnails are cached in maximum resolution and scaled down on the fly. Because the profile widget took its pictures from the photo list model, an extra picture copy with a fixed size had to be introduced. The UI is still a bit crude. Reported-by: Stefan Fuchs <sfuchs@gmx.de> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-18Make protected DivePictureModel members privateGravatar Berthold Stoeger
The constructor and the list of pictures was protected, but the class neither had friends nor subclasses (a subclass was removed in a recent commit). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-18Make scaleImages() a static functionGravatar Berthold Stoeger
It was only used by the DivePictureModel class, no need to export it. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-18core: ignore bogus m in cylinderGravatar Jan Mulder
A bogus key/value pair was introduced in the cylinder, consisting of a lonely "m" without value. This is caused by commit 46004c39e26 and fixed in 48d9c8eb6eb0. See referenced commits for more info. Just ignore this key/value pair. No processing is broken due to this, as the git storage stores only metric SI type data. In fact, the m unit is superfluous anyway. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-18Allow to read factor cache concurrentlyGravatar Robert C. Helling
In a session with the profile I saw that the planner spends a lot of time waiting to obtain the lock for the factor cache. Most of the time we are only reading that cache and that is save to do in parallel (according to the Qt IRC channel). So we can use a QReadWriteLock instead of a QMutex. This appears to be quite a performance boost, in particular for VPM-B Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-12-18Update download URL for libzipGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-12-18Compile with -O2 optimization even in debug modeGravatar Berthold Stoeger
The -O0 default is useless owing to extremely convoluted assembly. Moreover, many warnings depending on data analysis are ineffective with -O0. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-18CHANGELOG.mdGravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-18mobile: exit edit mode when navigating away from edit pageGravatar Jan Mulder
Navigating using the breadcrumb in the header did leave the dive detail edit (and add) mode in such a way that (for example) navigation in the dive list was suspended. Obviously, it is debatable what should be done. Saving the edits/add, or cancelling them. For now, this commit cancels them silently. This is the exact same thing that is happening when the user selects the dive list from the drawer menu. Fixes: #932 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-18Elevate "can't write hashes" message from debug to warning levelGravatar Berthold Stoeger
I never realized that my hashes weren't written, because it only outputs a debug instead of a warning message. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-18core: fix git storage save (regression 4.7.4 -> 4.7.5)Gravatar Jan Mulder
Commit 46004c39e266fe7 introduces a new field in the logbook outputs (depth of a cylinder). While in XML the depth unit is stored with a space between value and unit (m), in our git storage, the unit m is without space. As the git storage parser uses a space to separate individual key/value pairs, the erroneously saved space results in parsing warnings when opening the logbook. The unwanted space is normally saved just after download of a new dive from the dive computers, so all desktop-git-storage uses are affected, and more worrying, mobile beta users. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-17Cleanup: mark parameter as unusedGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>