This makes it marginally easier to deal with debug builds and release builds in
parallel. The quick builds work most of the time, but not always.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
And the way this gets bundled into an iOS app means that we have to declare
permissions that we don't use because the SDK we use could use them. On some
level I can understand that logic, but in general... this is just dumb.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
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>
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>
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>
These are the small dots that describe dragable points on
the profile when in the planner. It makes no sense to have
them in desktop's planner-widget code. They belong to the
profile.
Therefore, move the code there and compile on mobile.
Not everything can be compiled on mobile for now, but it
is a start.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
It's frustrating that I can't get the translation.qrc support the translation
files to be created in the build directory. Having them as part of the sources
just feels wrong.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
That always was such a weird choice.
This also adjusts to a minor change in the layout of libgit2 sources.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This was changed in commit 9ed886e4be ("Cleanup: lower-case filenames in
core/subsurface-qt/") but since iOS builds happen on a case-insensitive
file system, no one ever noticed.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since dive.c is so huge, split out divecomputer-related functions
into divecomputer.[c|h], sample.[c|h] and extradata.[c|h].
This does not give huge compile time improvements, since
struct dive contains a struct divecomputer and therefore
dive.h has to include divecomputer.h. However, it make things
distinctly more clear.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
In an effort to reduce the size of dive.h and dive.c, break out
the event related functions. Moreover event-names were handled
by the profile-code, collect that also in the new source files.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Add commands for deleting devices and editing device nicknames
to include the device-handling in the undo system.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The XML-parameter code is a mess. Ownership is unclear. Allocation
and freeing of strings is in different functions. Sometimes
only every second string is free()d, because keys are not copied.
But this is done inconsistently. The caller has to know how
many parameters the callee may add.
Instead, let's add a small helper-struct that uses C++ memory
management, but exports a C-API. The array for the XML-library
is generated on the fly.
This is only the implementation, the old code is not yet replaced.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Add undo commands to add / edit / delete filter presets.
These are styled after the other undo commands: On changes,
the UI is informed by DiveListNotifier signals. Editing is
a simple std::swap of values.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Implement a trivial model to provide the filter preset names
to the UI. Sadly, for now this features the QWidget/QML
column / name dichotomy. However, in this simple case that
shouldn't be too much of an issue.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Add a rudimentary list of filter presets to the core. The list
is sorted by name. Access is provided via a C interface so that
the presets can be written to the git and XML logs. Internally,
the list is realized by a C++ vector for convenience (euphemism for
laziness).
Morover, a C++ interface is provided for the UI. Currently names of
the presets cannot be edited, since this would mean that the order
of the list changes. This may be implemented later if required.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Add a model that keeps track of a list of filter constraint and makes
them accessible from Qt. Sadly, this is mostly repetitive boiler-plate
code, but this is due to Qt's model/view-API, which is a perfect example
of how *not* to design a reasonable modern API.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Adds a filter constraint object to the core, which represents one
constraint the user can filter dives with. The plan is to write these
constraints to the XML and git logs. Therefore, this code is written
in C-style except when it comes to handling strings and dates, which
is just too painful in plain C.
There is one pointer to QStringList in the class, though when compiled
with C, this is simply transformed into a pointer to void. Granted,
that smells of an ugly hack. However it's more pragmatic than
self-flaggelation with C string and list handling.
A filter constraint is supposed to be a very general thing, which can
filter for strings, multiple-choice lists, numerical ranges and date
ranges.
Range constraints have a range mode: less-or-equal, greater-or-equal
or in-range. Text constraints have a string mode: startswith, substring
or exact.
All the data are accessed via setter and getter functions for
at least basic levels of isolation, despite being written with
a C-interface in mind.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
core/device.h was declaring a number of functions that were related
to divecomputers (dcs): creating a fake dc for manually entered dives
and registering / accessing dc nicknames. On could argue whether
these should be lumped together, but it is what it is.
However, part of that was implemented in C++/Qt code in a separate
core/divecomputer.cpp file. Some function therein where only
accessible to C++ and declared in core/divecomputer.h.
All in all, a big mess. Let's simply combine the files and
conditionally compile the C++-only functions depending on
the __cplusplus define.
Yes, that means turning device.c into device.cpp. A brave soul
might turn the C++/Qt code into C code if they whish later on.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Dives for the seac action computer are imported by the seacsync
program into two tables in an sqlite3 database.
The dive information is read from the headers_dive table.
The dive_data table is then queried for each dive to get samples.
The seac action computer is the only current supported computer
by the seacsync program. It only supports two gas mixes, so the
parser will toggle between two cylinders whenever it detects a
change in the active O2 mix.
Dive start time is stored in UTC with a timezone offset.
A helper function to read this was added to qthelper.
Default cases have been added to some switch statements
to assist in future development for other dive types and
salinity.
Example database has been added to ./dives/TestDiveSeacSync.db
Signed-off-by: James Wobser <james.wobser@gmail.com>
Number 3 overall committer with currently 9% of total commits and 27% of all
commits in the last three years.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
By using a std::string instead of a C-string, memory management
becomes so much simpler! This class will be used for keeping track
of deleted/added pictures in the undo system.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Even though the functionality is seemingly trivial, this is a bit
invasive, as the code has to be split into two distinct parts:
1) Post undo command
2) React to changes to the divelist
Don't compile that code on mobile.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
I don't know why this is suddenly needed and wasn't before, but hopefully
this fixes the broken builds on GitHub.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The inconsistent-missing-override warning is annoying as it prevents
us from adding "override" modifiers: It will warn if we do this only
for selected functions. Sadly, this is the default on clang. Therefore,
we disable this warning for quite some time in CMakeLists.txt. For
consistency also do this in the Subsurface-mobile.pro file.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The weight-undo commands need this. Therefore, we have to compile the
WSInfoModel if we want to access the undo commands from mobile.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Create a model which represents all top-level items and, potentially, one
expanded trip as a flat list.
Pass down roles to the source model and let the source model handle that. We'll
have to do some ifdef-ery, but so be it.
Additionally, compile the base model on mobile as well.
This contains a couple of hacks to make things compile at all.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since the official Qt binaries can no longer be installed without disclosing
credentials (well, sure, that could be done through secrets), I decided that
we should go back to packaging just the part of the iOS Qt SDK that we need.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead of passing the dive summary via a completely unstructured
QStringList to QML, implement a dynamic model. For potential reuse
on desktop (though somewhat unlikely) the model has two interfaces,
one for QtWidgets and one for QML. The former is based on columns,
whereas the later is based on roles. The number of columns is
set dynamically. The roles currently support access to two columns.
If more columns should be accessed from QML, more roles have to
be added manually.
This commit only creates the model and hooks it into QMLs global
context, but does not yet change the QML page.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>