aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-12-19undo: fix annoying warning message when deleting picturesGravatar Berthold Stoeger
The RemovePictures command filters the pictures provided by the UI: only actually existing pictures are removed. The code was buggy: the original list was copied and then the filtered list was added. Thus, every picture was listed twice leading to annoying warning messages. Remove the copy. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-19undo: add \n to console warning error messagesGravatar Berthold Stoeger
To make the output more readable. Moreover, fix a comment-typo. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-19downloader: Fix typo in libdivecomputer includeGravatar henrik242
Signed-off-by: henrik242 <henrik242@users.noreply.github.com>
2020-12-17core: remove DiveObjectHelperGravatar Berthold Stoeger
Since switching to the mobile-models and removing grantlee, DiveObjectHelper was demoted to a thin wrapper around string formatting functions. The last user was removed in a previous commit. It was never a good idea, given QML's strange memory-management. Let's remove it. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17mobile: remove DiveObjectHelper codeGravatar Berthold Stoeger
When editing a dive, a DiveObjectHelper of the unmodified dive was created to compare the edited with the old values. Since the DiveObjectHelper is used here only as a pointless wrapper around the formatting functions, call these functions directly. However, note that the code is in principle wrong since the change to the mobile-models, which do not use the DiveObjectHelper. The real fix would be to reload the data from the model to prevent going out-of-sync with respect to the formatting routines! Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17printing: remove CylinderObjectHelperGravatar Berthold Stoeger
With the removal of grantlee, this became pointless glue code. Call the formatting functions directly. Since the printing code was the only user of CylinderObjectHelper, remove the whole thing. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17printing: remove DiveObjectHelper from printing codeGravatar Berthold Stoeger
At this point (post grantlee), DiveObjectHelper is just pointless glue code. Let's remove it from the printing code and call the formatting functions directly. If necessary, move these functions to core/string-format.cpp. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17printing: remove DiveObjectHelperGrantleeGravatar Berthold Stoeger
This was a weird helper object, needed for grantlee. Instead of storing this object, loop over cylinders and dives directly. The actual accessor function is unchanged and now generates a DiveObjectHelper or DiveCylinderHelper for every variable access. Obviously, this is very inefficient. However, this will be replaced in future commits by direct calls to formatting functions. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17core: create string-format.cpp source fileGravatar Berthold Stoeger
The mobile version of the list used string formatting functions defined in DiveObjectHelper and declared in mobilelistmodels.h. Very confusing. Move them to a separate source file where - in the long run - all the string-formatting functions, which are scattered all over the place, can be collected. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>