aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-04-24cleanup: move get_dc_nickname from qthelper.cpp to divecomputer.cppGravatar Berthold Stoeger
1) qthelper is already huge. 2) set_dc_nickname et al. is already there. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-24filter: add a week to maximum default date timeGravatar Berthold Stoeger
The filter sets the maximum date to now. This is so confusing when you manually add a dive and it isn't shown, because it is slightly in the future. Add seven days, that should help. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-24filter: implement filtering for divemodeGravatar Berthold Stoeger
This only checks the first divecomputer as the semantics for multiple dive computers with different dive modes are not clear. Should we check them all? The implementation is a bit hackish: the indexes [0...n] of the combobox are mapped onto [-1...n-1], where -1 means don't filter and n-1 is the last valid dive mode. Implements #2329 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-21cleanup: replace constructs of the type &vector[0] by vector.data()Gravatar Berthold Stoeger
It appears that some misguided compiler / library combinations crash on &vector[0] for empty vectors. Even though very unfriendly, they are technically correct, so let's remove these constructs. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-21desktop: don't access first data element if no cylindersGravatar Berthold Stoeger
TabDiveInformation::updateProfile() does some statistics via the per_cylinder_mean_depth function. It passes down arrays with one entry per cylinder, which are allocated by means std::vector. To pass the array, the expression "&vector[0]" is used. It seems like some compilers through an assertion violation if vector has no elements. They are technically correct in that this is undefined, but still this appears like very unfriendly behavior. After all, std::vector should behave just like a dynamic C-array that is automatically freed, when going out of scope. Replace the "&vector[0]" by "vector.data()" and don't do the call if there aren't any cylinders for good measure. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-20core: return -1 from explicit_first_cylinder() if dive has no cylindersGravatar Berthold Stoeger
Arguably, returning 0 for a dive with no cylinders is wrong, since the 0 is a valid cylinder id, however that cylinder doesn't exist. Instead, return -1. All callers of explicit_first_cylinder() return early anyway for dives with no cylinders. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-20profile: avoid invalid accesses in setup_gas_sensor_pressureGravatar Berthold Stoeger
Since we removed MAX_CYLINDERS, we have the possibility of dives with no cylinders. In such a case, setup_gas_sensor_pressure() would do invalid read- and write-accesses. Therefore, return early in such a case. Reported-by: Chirana Gheorghita Eugeniu Theodor <office@adaptcom.ro> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-20desktop: rearrange widgets on the dive site tabGravatar Berthold Stoeger
Move the more commonly used filter to the left and the less commonly used "purge unused sites" button to the right. Add a spacer so that the filter-textbox doesn't extend over the whole free space. With apologies to sinistroverse users (is there an option to make the layout direction depend on the locale?). Suggested-by: Hartley Horwitz <hhrwtz@gmail.com> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-19maps: show the dive site when opening Google mapGravatar Dirk Hohndel
I'm not sure if Google used to show the POI marker at the center location in the past or if this is actually a new feature. Either way this appears to do the right thing in my testing. Note that we need a 'plus' to connect the point of interest cooridnates, but a 'comma' to connect the map center coordinates. Reported-by: Chirana Gheorghita Eugeniu Theodor <office@adaptcom.ro> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-19desktop: remove user surveyGravatar Dirk Hohndel
We have never made good use of the results. Let's just remove it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-19documentation: update bundled HTML user manualGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-19build-system: cleanup Ubuntu/Debian scriptGravatar Dirk Hohndel
This code block was also for the OBS builds and is no longer needed now that we have to separate make-package scripts. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-19[smtk-import] Fix useless NULL check and white space issuesGravatar Salvador Cuñat
As commented by Berthold and Dirk for previous patches. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2020-04-19[smtk-import] add some sanity checksGravatar Salvador Cuñat
Under some circustances values stored in this arrays may be NULL or even previously freed. Check them to avoid further crashes. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2020-04-19[smtk-import] Do not create cylinders structure before libdc parsingGravatar Salvador Cuñat
The d->cylinders created will be overriden by libdivecomputer parsing, resulting in 0, 1 , may be 2 cylinders depending on DC data. This is not what we want when importing a divelog, because we will miss all hand entered tanks. BTW, using get_cylinder() on tank number bigger than created, results in a NULL pointer and a crash. As we can't foresee how many tanks (or even it's positional numbers in log) a diver has used, the full 10 tanks supported by SmarTrak can be easily created and parsed using get_or_create_cylinder(), and unused cleaned later. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2020-04-19Change to user-manual (Dive export)Gravatar willemferguson
This brings the user manual in line with the recent changes to the layout of the export panel. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
2020-04-19build-system: simplify and clean up OBS make-package scriptGravatar Dirk Hohndel
The previous version wasn't quite ready for prime time. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-19build-system: remove OBS support from Ubuntu/Debian scriptsGravatar Dirk Hohndel
This feels much cleaner. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-19build-system: create separate OBS make-packageGravatar Dirk Hohndel
It seemed very odd to have those steps mixed in with the Ubuntu/Debian instructions. Yes, there is a bunch of overlap, but this seems much cleaner. This also updates the spec files to something that works for the current sources. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18cleanup: fix image reference in Android READMEGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18mobile: update version to 3.0.5Gravatar Dirk Hohndel
I keep forgetting to do that right after a release. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18build-system: update Ubuntu/Debian package scriptGravatar Dirk Hohndel
This cleans up a lot of the ancient mess in that file. It's still confusingly usable to push sources to OBS as well (but that's now hidden behind an option) and it is still somewhat custom-made for me, but it should be much easier to reuse for others now. In addition to Subsurface and libdivecomputer we are inclooding the googlemaps sources and libgit2 1.0.0 sources. Bionic is the only remaining distro that we support that doesn't have a new enough version of libgit2 (0.26 is the minimum we expect), but since we are linking statically against it, maybe it's best to simply force all of these builds to include libgit2 1.0.0. Handling of the debian/* files in the script has been changed quite a bit to make it easier for others to create a working setup. It now updates all of the files with the exception of the changelog files from the sources we are building from. I am hoping that this will be a not-so-subtle incentive for me to keep the bundled versions up to date. Since we no longer do beta releases, I removed that part from the file. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18build-system: remove references to docs we no longer shipGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18build-system: silence one more warning for Ubuntu/Debian buildsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18build-system: get ready for switching to libgit2 1.0Gravatar Dirk Hohndel
We want to build this against its own regex package to avoid adding more system dependencies. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18build-system: add missing dependencies for Ubuntu/Debian buildGravatar Dirk Hohndel
And acknowledge the current file format standard. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18build-system: update copyright years in Ubuntu/Debian filesGravatar Dirk Hohndel
And remove an optional entry (which we would have to keep changing otherwise). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18build-system: add valid Ubuntu/Debian changelog fileGravatar Dirk Hohndel
We don't want to try to track every change to this file in our source repo, so this starting point is as goos as any. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18Reorganise and reword divelog export panelGravatar willemferguson
Perform slight reorganisation and rewording of the divelog export panel. Specifically the wording is changed and expanded to make clear the 2 types of export of profile data. All the CSV export options are grouped together. With respect to profile export to CSV format, it is made clear that one option concerns export of dive computer-related profile data, whereas the other option involves export of computed dive profile data from the Dive Profile panel. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
2020-04-18Changes to user manual for version 4.9.4Gravatar willemferguson
Six images are changed and several changes are made to the text of the user manual Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
2020-04-18update CHANGELOGGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18core: debug cert callsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18core: bring back libgit2 certificate callbackGravatar Dirk Hohndel
Turns out that at least on Android libgit2 sometimes rejects valid certificates. And I cannot quite figure out when and why. But since we actually already checked the validity of the certificate when we called canReachCloudServer() (and the Qt code handles certificates correctly), we'll simply ignore this here and override the check to always return true for our cloud server. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18debug output: ensure our debug output is captured on AndroidGravatar Dirk Hohndel
I would have bet money that Android used to send stderr to the logcat log, but apparently it doesn't (anymore?). So in order to be able to have a chance to debug weird cloud storage issues on Android, let's do some wholesale replacement of fprintf(stderr,...) with our own version of the INFO macro that we long ago borrowed from libdivecomputer (and rename it to ensure we don't have a conflict there). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18mobile UI: indicate status of verbose flagGravatar Dirk Hohndel
This way the user can verify that they have set the log to verbose mode in the developer menu. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18Fix CSV for profile exportGravatar Robert C. Helling
The function to print a double did not print a comma while the lines ended in a comma. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-04-18profile: avoid double-free when reusing plot_infoGravatar Berthold Stoeger
free_plot_info_data() freed the pressure-data, but didn't set the value to NULL. Thus, when the plot_info was reused, a double-free() could ensue. Crash condition: export the profiles of multiple dives with pressure data. Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-15testing: re-enable TestGitStorageGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-15testing/git-storage: don't override test accountsGravatar Dirk Hohndel
We now have a much better way of dealing with the issue of colliding tests inside the test. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-15testing/git-storage: alternative random number generation for Qt 5.9Gravatar Dirk Hohndel
We still need to support Qt 5.9 for Ubuntu 18.04 / Bionic. This uses deprecated calls to qrand() - but then qrand() wasn't deprecated in 5.9. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-15testing/git-storage: fairly fundamental rewrite of the storage testGravatar Dirk Hohndel
The old test was broken in many ways and kept failing for a number of reasons. Some of them were addressed in the previous commits (the missing HEAD ref being the main one), the other one was that the tests kept stepping on top of each other - as were potentially random users or reviewers using the 'universal' test account. This uses a random one of ten dedicated test accounts, and on top of that uses a random branch name (instead of the fixed email address associated with the account). This also rewrites several of the tests dealing with offline changes to correctly model going offline (but keeps one that directly writes to the local cache). Finally this change also tries to do a much better job cleaning up after itself and not leaving data behind the the next run could stumble over. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-15git-storage: add additional debug outputGravatar Dirk Hohndel
This helps the user figure out why we weren't able to write a tree. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-15git-storage: add helper function to delete remote branchGravatar Dirk Hohndel
This will be used by the test to clean up test branches that are created on the server. Since we aren't testing that functionality (it's not something that Subsurface itself ever does) the helper prints out errors it encounters, but doesn't report them back to the caller. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-15git-storage: fix up old broken local caches to use the right branchGravatar Linus Torvalds
If you had one of the unfortunate local git caches with a local HEAD just pointing to 'master', this will make note of that and then fix it up to use the proper branch name in the cache repository. [Dirk Hohndel: demoted from error to fprintf as most users won't care] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-15git-storage: make creation of empty cache repo set the initial branchGravatar Linus Torvalds
In create_and_push_remote(), we set up the remote tracking etc to use the proper branch name, but never actually set up the initial local branch for the new cache repository at all. So the repository would end up with the default 'master' branch, instead of the branch name it should have. This went unnoticed, because most setups start by initializing the git caches by cloning from the cloud, and that worked fine. Debugged-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-04-13cleanup: turn protected into private membersGravatar Berthold Stoeger
Some profilewidget classes hat protected members which can be made private as there is no subclassing. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-13cleanup: remove protected access specifier in ProfileWidget2Gravatar Berthold Stoeger
There were a number of protected member functions in ProfileWidget2. However no class subclassed ProfileWidget2, so this appears to have been an artifact. Therefore, make these functions private. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-13dive sites: properly reload dive site model on desktopGravatar Berthold Stoeger
In 9310d72943390f95d6742c2d5b40f025a40b4008, resetting of the dive sites was moved to DiveTripModelBase::reset(). This seemed like a good idea, because it means that the location list is reloaded every time the dive list is reset. Unfortunately that function is only used on mobile, thus on desktop the dive site model is not updated. Do that in MultiFilterSortModel::resetModel(), because this is always called when the dive list is reset. Desktop differs from mobile in that two different models are used depending on whether we are in list or in tree mode. Fixes #2749 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-13desktop: remove special QGroupBox stylesheet for non-Windows systemsGravatar Berthold Stoeger
That style-sheet made things look really ugly on most Linux themes. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-13mobile: update version to 3.0.4Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>