aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2019-10-26Mobile: more code to deal with undefined elementsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: reset dive list after applying GPS fixesGravatar Dirk Hohndel
This way new fixes are actually shown when the user looks at the dive list after applying the GPS fixes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: don't show nothing for the locationGravatar Dirk Hohndel
We use 'Dive details' as page title, everywhere else we use '<unnamed dive site>'. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: fix incorrect variable dereference for dive siteGravatar Dirk Hohndel
Since we are accessing the model, this is the variable we should use. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: don't push map page if it's already on the stackGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: avoid dereferencing undefined valuesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: fix cacheBuffer for log windowGravatar Dirk Hohndel
The old value made no sense at all. Why would we want to cache up to 10k entries of the log? Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Undo: simplify profile repainting codeGravatar Berthold Stoeger
The profile repainting code that was called when a dive changed was located in a separate function. Not only did it take a redundant parameter, it also performed very weird stuff like entering and exiting plan state. That did not work at all. Replace by a simple call to plotDive() and things work much better. There was a comment about DivePlannerPointsModel and profile getting out of sync. So let's keep an eye out for that. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-10-26Undo: turn dive- and trip-fields into flagsGravatar Berthold Stoeger
The divesEdited signal sends the changed field as a parameter. Since some undo-commands change multiple fields, this led to numerous signals for a single command. This in turn would lead to multiple profile-reloads and statistic recalculations. Therefore, turn the enum into a bitfield. For simplicity, provide a constructor that takes classical flags and turns them into the bitfield. This is necessary because C-style named initialization is only supported on C++20 onward! Is this somewhat overengineered? Yes, maybe. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-10-26Undo: update statistics if dive changedGravatar Berthold Stoeger
On undo/redo, the dive statistics tab was not updated even if a selected dive was changed. Fix that. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-10-26Desktop: use undo command when replanning diveGravatar Berthold Stoeger
Instead of copying the displayed dive, generate an undo command. This makes the replanning an undoable action and fixes a bug where the dive details have not been updated correctly. Fixes #2280 Reported-by: Stefan Fuchs <sfuchs@gmx.de> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-10-26Undo: implement ReplanDive commandGravatar Berthold Stoeger
Implement an undo command that overwrites the dive-computers and cylinders of the current dive with a given dive. This will be used when replanning a dive. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-10-26Desktop: make salinity a field known to the undo systemGravatar Berthold Stoeger
The undo system sets updates individual dive fields on redo respectively undo. Make salinity such a field, since it is changed on replanning a dive. To do this, break out the "update salinity" functionality into its own function, add an entry to the DiveField enum and add the corresponding switch-case. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-10-26Core: export dive-computer freeing functionGravatar Berthold Stoeger
The dive-computer freeing code was local to dive.c. Implementing the replan undo-command will need that functionality. Therefore, export it as a global function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-10-26Cleanup: use correct loop boundsGravatar Dirk Hohndel
I'm a bit confused why this enum has two extra values, NUM_DIVEMODE and UNDEF_COMP_TYPE. I can see how this could create confusion. This may benefit from addition review. Found by Coverity. Fixes CID 350092. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Cleanup: free nickname only onceGravatar Dirk Hohndel
Found by Coverity. Fixes CID 350123 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26GitHub Actions: one more set of typos fixedGravatar Dirk Hohndel
I am at a loss for words. Especially as we didn't need those quotes in the first place. What was I thinking? Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mares: improve BT discovery logicGravatar Dirk Hohndel
At least in one of the logs we saw there seemed to be trailing spaces. It should be enough for the BT name to start with "Mares Genius" in order to be recognized. Suggested-by: Jef Driesen <jef@libdivecomputer.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-25GitHub Actions: fix several errors in previous commitsGravatar Dirk Hohndel
I have no excuse. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-25GitHub Actions: add apt-get update before installing curlGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-25GitHub Actions: only build pushes into and PR against masterGravatar Dirk Hohndel
This should fix the odd double builds for people who create branches for pull requests in the main repository. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-25GitHub Actions: push to transfer.sh for PRs, post release for pushesGravatar Dirk Hohndel
This means that PRs from people using the main repo for their staging branches will get both transfer.sh and a release. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-25GitHub Actions: run them on pull requests as wellGravatar Dirk Hohndel
I wonder if this will cause issues where the actions sometimes run twice. But we'll deal with that rather than dealing with not having the tests on pull requests. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-25Mares: add BT discovery logicGravatar Linus Torvalds
We don't have the "show all dive computers" logic on mobile, so we need something like this. Possibly we should use the libdivecomputer matching code if it exists, but that's a much bigger change, let's do this incremental one for now. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-10-24Update libdivecomputerGravatar Dirk Hohndel
- Add support for the Oceanic Geo 4.0 - clean up Shearwater tank pressure handling - minor fixlets Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-23GitHub Actions: Add automatic coverity scanGravatar Anton Lundin
This adds a automatic coverity scan build based on linux-bionic-5.9.yml Signed-off-by: Anton Lundin <glance@acc.umu.se>
2019-10-21Small update to the mobile manualGravatar Dirk Hohndel
The edit description wasn't detailed enough to need changing, but I noticed a reference to behavior that we have disabled. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-21Mobile: allow editing dive numberGravatar Dirk Hohndel
No checks regarding duplicate numbers - we trust the user knows what they are doing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-20Mobile: remove remaining accesses to DiveObjectHelper from QMLGravatar Dirk Hohndel
Add a couple more roles and remove the dive role that allows accesss to the DiveObjectHelper in the first place. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-20Core: move cylinder list getter into helper functionGravatar Dirk Hohndel
Thie way we can use it from the dive list model. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-20Mobile: get dive details directly from the modelGravatar Dirk Hohndel
By getting a DiveObjectHelper and then dereferencing that we ended up creating hundres and hundreds of these objects, only to immediately destroy them after using a tiny part of the data. Instead make those data available directly from the model, without having to create a DiveObjectHelper forst. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-20Core: make helper functions globalGravatar Dirk Hohndel
We'll use them from the model in order to avoid creating this many DiveObjectHelpers when showing a dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-20Core: debug helper for DOH constructorGravatar Dirk Hohndel
This is disabled by default - but when compiled in it makes it a lot easier to pinpoint why we are creating so many DiveObjectHelpers. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-20Planner: copy deco state before passing it to worker threadGravatar Berthold Stoeger
The planner has a computeVariations() function that can be run in a worker thread. The code was not thread safe: a deco_state object allocated on the stack of the caller was passed down to the worker thread. It's well possible that the object would go out of scope before the thread run. Therefore, when running in the background, copy the object first and free it in the worker thread. Side note: Qt makes proper memory management again as difficult as possible: You can't pass a std::unique_ptr<> to QtConcurrent::run, because move-only objects are not supported. Not very friendly! Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-10-20GitHub Actions: fix logic error for new tagsGravatar Dirk Hohndel
It is clear why this wasn't caught in my testing, but the bug should have been really obvious simply reading through the code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-20Cleanup: use pointer-to-member-function in addAction() callsGravatar Berthold Stoeger
Since requiring Qt >= 5.9.1, we can use the pointer-to-member-function overloads of addAction (introduced in Qt 5.6). This has the advantage of compile-time checking of the signal/slot parameters. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-10-19Travis: remove last Travis buildsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-19GitHub Action: add iOS buildGravatar Dirk Hohndel
This is incredibly brute force, downloading a 3+GB installer and installing all of the Qt/iOS binaries. This first attempt is mainly to get an idea how long this will take and if this will fit within the size constraints of the build VM. This commit doesn't even try to build, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-18Travis: remove redundant buildsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-18GitHub Actions: add Linux Bionic / Qt 5.9 buildGravatar Dirk Hohndel
No artifacts from this build are preserved, this is just to make sure that we can still build the desktop version against Qt 5.9. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-18GitHub Actions: add Android buildGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-18GitHub Actions: improve naming and location of filesGravatar Dirk Hohndel
Just to make things a little more consistent. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-18GitHub Actions: support creation of releases based on tagsGravatar Dirk Hohndel
And fix parsing of ref. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-18GitHub Actions: post releasesGravatar Dirk Hohndel
This so far just works on push and hopefullt pull requests, not for tags and therefore actual releases. In order not to conflict with the binaries from Travis, I changed the name to "ci-release" instead of "continuous". Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-18GitHub Actions: build Windows binariesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-16GitHub Actions: add Linux Qt 5.12 container buildGravatar Dirk Hohndel
The AppImage works - I just need to figure out how to post releases. For now it'a available on the Actions page as Artifact. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-14GitHub Actions: first CI/CD build for Mac based on GitHub ActionsGravatar Dirk Hohndel
This feature is in beta right now and might change without notice, but instead of dealing with the broken Travis Mac builds, this does seem progress. The build artifact seems to work, but it's a bit more painful to get to. Go to https://github.com/Subsurface-divelog/subsurface/actions and click on the corresponding run - it's then in the top right corner under Artifacts. The one oddity is that after unzipping the file you need to manually make Contents/MacOS/Subsurface executable. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-14Desktop: update to Grantlee 5.1Gravatar Dirk Hohndel
Also make sure Grantlee still compiles with Qt 5.13 by cherry picking a commit that was added after the v5.1.0 release. In order to identify this commit as comming from the build automation we temporarily override the user name and email address. As a side effect this also makes this work on Travis. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-14Mobile: ensure input fields stay visible after keyboard opensGravatar Dirk Hohndel
When the user taps on a TextField to enter text, usually the virtual keyboard will pop up. This code tries to ensure that the keyboard doesn't cover the entry field that the user was trying to work on. In order to centralize these changes, this introduces a new SsrfTextField type which we use to also remove a few redundant default settings that we previously had for every field. The one TextArea for the Notes field didn't seem worth creating yet another type for, so there the changes are done directly in DiveDetailsEdit. The awkward timer mechanism is necessary as the keyboard pops up asynchronously and then triggers a change of height for the app, so we need to wait a little bit before doing the adjustment. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-14Mobile: pick icons depending on themeGravatar Dirk Hohndel
QML has ways to style icons - and we use that for the main theme color, but it doesn't seem to work (anymore?) for the edit and save icons. Instead of tracking down what changed there, simply switch between icons with different foreground color, depending on theme. All the other icons seem to work well in all three themes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>