summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-12-17cleanup: remove QPointer instancesGravatar Berthold Stoeger
QPointer is a strange "smart" pointer class, which resets itself when the pointed-to QObject is deleted. It does this by listening to the corresponding signal and therefore is surprisingly heavy for a plain pointer. A cynic would say that the existence of QPointer is an expression of Qt's broken ownership model. In any case, QPointer was only used at two places, were it was 100% useless: As a parameter to a function and as a locally scoped pointer. It only makes sense if a) there is a chance that the object disappears during the pointer's lifetime and b) it is actually checked for null before use None of which was the case here. Remove. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17printing: move #includes from headers to source filesGravatar Berthold Stoeger
To decrease include-file interdependencies. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17printing: remove YearInfo structureGravatar Berthold Stoeger
This is a wrapper around "stats *" used to pass statistics through Qt's weird metatype system. Not needed anymore. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17printing: replace dive master by dive guide in templatesGravatar Berthold Stoeger
This does not rename the variables, only the user-visible output. Case "Dive guide" vs. "Dive Guide" is according to the rest of the templates. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17printing: refactor if and loop codeGravatar Berthold Stoeger
The loop code was buggy: the current position was only increased inside when executing the loop once. This would obviously fail for empty lists. Moreover, the whole thing was quite difficult to reason about, since a reference to the current position was passed down in the call hierarchy. Instead, pass from and to values to the parse function and create a generic function that can search for the end of loop and if blocks. This function handles nested if and for loops. The if-code now formats the block only if the condition is true. The old code would format the block and throw it away if not needed. This should now provide better diagnostics for mismatched tags. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17printing: remove objects QVariant mapGravatar Berthold Stoeger
An artifact from the old grantlee code: the whole parser state was kept in an untyped QVariant map. One case was particularly bizarre: the options were a class member and yet added to the weird map. Replace this by a strongly typed state structure. Ultimately, this will allow us to replace the "dive object helper". Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17cleanup: make templateOptions and printOptions reference typesGravatar Berthold Stoeger
These two structs describe options used during printing. They are passed through numerous classes as pointer. In this case, reference semantics are preferred, as references: - can never be null - can not change during their lifetime This not only helps the compiler, as it can optimize away null checks, but also your fellow coder. Moreover, it prevents unintentional creation of uninitialized references: one can't create an instance of a class without initializing a reference member. It does not prevent references from going dangling. However, pointers have the same disadvantage. Contains a few whitespace cleanups. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17build-system/iOS: fix minimum iOS version supportedGravatar Dirk Hohndel
Qt requires iOS 10, let's not pretend that we can support ancient iOS 6. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system/iOS: remove outdated build-ios directoriesGravatar Dirk Hohndel
The places we build things are still rather inconsistent for historic reasons - this definitely deserves some more cleaning up. The top level build-ios dir was completely unused, and the build location for the googlemaps plugin was inconsistent with all of the other build dirs. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17mobile: update version to 3.1.1Gravatar Dirk Hohndel
3.1.0 was never released, but this is a quick hack to work around a versioning issue in the iOS app store. Not ideal, but at least it works. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17add CHANGELOGGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17mobile: adapt resource namesGravatar Dirk Hohndel
With the new Kirigami the URI for the backwards and forwards arrows apparently changed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17Android: improve documentation and setup scriptGravatar Dirk Hohndel
This has now been verified to work on a fresh clean Ubuntu 20.04 install, both using the docker image route as well as the full local build system. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17GitHub Action/iOS: build in the right directoryGravatar Dirk Hohndel
The way I test things locally I build in the directory above the subsurface directory. Let's match this on GitHub as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17GitHub Actions: better job namesGravatar Dirk Hohndel
This makes it more obvious which action actually failed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17Github Actions: switch to Ubuntu 20.04Gravatar Dirk Hohndel
19.10 is no longer receiving updates and causing problems when running the tests. 20.04 also uses Qt 5.12. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system/iOS: ensure icons are bundledGravatar Dirk Hohndel
We already did this for Android, so let's just always do it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system/iOS: remove obsolete .pro fileGravatar Dirk Hohndel
We now use a shared one in the root directory. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system/iOS: create the build directory parallel to subsurfaceGravatar Dirk Hohndel
This seems more consistent with how we do things elsewhere. Also make sure that the ssrf-version.h file is created in the correct directory. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system/iOS: build Kirigami separately for iOS as wellGravatar Dirk Hohndel
Since the integrated build no longer seems to work, this creates a separate Kirigami build using qmake (as I couldn't make Kirigami's cmake build work). The install target tries to install into the Qt install which may not be possible with a user account, so this instead uses the built library directly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system/iOS: ensure cmake works for Qt buildsGravatar Dirk Hohndel
I stumbled across needing this when trying to build Kirigami via cmake (just like on Android). I abandoned that attempt, but there seems to be no harm in adding this. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system/Android: work around missing C compiler in our build containerGravatar Dirk Hohndel
This of course needs to be fixed in the build container itself, but for now this might be enough to make progress. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system/Android: we need to collect the ABIs earlierGravatar Dirk Hohndel
That's what happens if you develop a script like this sequentially. We need to have the ABIs picked in order to build googlemaps, otherwise this fails with the build container as that only includes the ARM libraries and tools. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system/mobile: force using our own ECM buildGravatar Dirk Hohndel
If the OS has an older one installed, that is found first and the build fails. This way we know that ours is used. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system: configure git when running GitHub ActionGravatar Dirk Hohndel
In order to apply the patches for Kirigami, git insists on having a valid user name and email. Also, don't build the mobile app when preparing the AppImage. That build already takes way too long and we test this in a few other actions. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system/Android: handle resource issuesGravatar Dirk Hohndel
It appears that the Kirigami shaders aren't bundled with the app. They should be part of the plugin, but somehow they aren't. This way things at least 'mostly work'. We also need the icons. And to make this a bit more structured, move those resource declarations into the Android part of the qmake file until we know how all this works out on iOS. The Android app is still fairly unusable with all kinds of weird font problems and many other issues, but at least it once again starts. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17mobile: more build hackeryGravatar Dirk Hohndel
So while the documentation explicitly says that you need to have the getInstance()registerTypes() call, that clearly is not supported if you build kirigami as a library. Even the required include file doesn't exist in the install-root. So let's try some other way to make this work. Heck if I know what the correct way of doing this might be. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17android/build-system: build kirigami as libraryGravatar Dirk Hohndel
Doing it this way using the cmake build system at least gets us to the point where everything links and appears to fit together. It still doesn't work at all, but hey, progress. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17mobile/qmake: use correct Kirigami filesGravatar Dirk Hohndel
And don't try to build kirigami in the same qmake run. The inclusion of the .pri file doesn't appear to lead to a build that works. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system/mobile: remove old scriptGravatar Dirk Hohndel
This was just kept around for reference. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17kirigami: maintain our patches relative to upstreamGravatar Dirk Hohndel
Having them as commits like this should make it easier to migrate them as we update the underlying Kirigami version. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17mobile/kirigami: add the shaders as resourceGravatar Dirk Hohndel
These should already be part of the kirigami plugin, but without explicitly adding them here they appear to not get found at runtime. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17mobile: fix implementation of menu back featureGravatar Dirk Hohndel
With the updates to Kirigami I slightly modified the hack that we use to implement that, as a result we call pop() directly on the globalDrawer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17mobile/kirigami: install our own copy of ECMGravatar Dirk Hohndel
Instead of relying on this being available as a system resource, treat it the same way as we treat Kirigami and the Breeze icons. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17mobile: re-add breeze iconsGravatar Dirk Hohndel
This time from the cloned repo. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17mobile: add yet another import path to find Kirigami QML moduleGravatar Dirk Hohndel
This needs some careful testing across the different OSs we are trying to support. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17mobile: avoid warning in QML codeGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17mobile: don't use reserved wordGravatar Dirk Hohndel
This used to work, but with current QML/Kirigami it throws an error. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17mobile: silly whitespace cleanupGravatar Dirk Hohndel
Simply because it bugged me. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17mobile/Android: register the Kirigami pluginGravatar Dirk Hohndel
According to the Kirigami documentation, this is only required on Android. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17mobile: use 3rdparty build of KirigamiGravatar Dirk Hohndel
This should allow us to use the kirigami version that was built as 3rdparty component. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17mobile/kirigami: first steps to switching to Kirigami 5.76Gravatar Dirk Hohndel
Our half-assed manual build of Kirigami was becoming completely unmaintainable. So let's try to use the build method that the Kirigami team recommends. Which unfortunately requires us to have access to the KDE extra cmake modules (ECM). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17core: correct AL* tankinfo sizes.Gravatar Berthold Stoeger
Recently (d16a9f118a) the tankinfo table was made dynamic, which means that the default tankinfos are added programatically. Thereby, the wrong function was used for AL* type of cylinders: metric instead of imperial. Fix those. Reported-by: Michael Andreen <harv@ruin.nu> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-13cleanup: remove MainWindow::stateBeforeEdit memberGravatar Berthold Stoeger
The last user was removed in accf1fcc8f6ad. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-13cleanup: remove unused typedefsGravatar Berthold Stoeger
Last users removed in ca6aa3813956b5e8be68b86ed36a5786b3ee746f. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-13prefs: add option to display only actually used tanksGravatar Berthold Stoeger
A user complained about the default cylinders list. Provide a preferences option to turn this off. When changing the preferences, the tank-info model will be completely rebuilt. Currently, this is a bit crude as this will be done for any preferences change. Suggested-by: Adolph Weidanz <weidanz.adolph@gmail.com> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-13core: remove the "no-name" tank infoGravatar Berthold Stoeger
There was a tank info with an empty name. According to a comment, this is needed for the "no cylinder" case. However, we now support empty cylinder tables, so this is not needed anymore. Therefore, remove it. Make sure that the user can still enter the empty name, just in case. But don't save the size and pressure in that case. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-13desktop: don't save data to the "no-name" tankGravatar Berthold Stoeger
There seems to be no point to saving data to the tank with the empty name. Don't save tank-pressure and size to that tank info. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-13core: free tank info table on exitGravatar Berthold Stoeger
This is obviously a pure code-hygiene thing. But with the new dynamic tank info table, this becomes trivial, so let's do it. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-13core: keep tank infos in a dynamic tableGravatar Berthold Stoeger
The list of known tank types were kept in a fixed size table. Instead, use a dynamic table with our horrendous table macros. This is more flexible and sensible. While doing this, clean up the TankInfoModel, which was leaking memory. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>