aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-10-29Dive site: Pass dive-site pointer to MapWidgetHelper::enterEditMode()Gravatar Berthold Stoeger
Replace the uuid argument to MapWidgetHelper::enterEditMode() by a pointer. Likewise, adapt the only caller prepareForGetDiveCoordinates(). This is a small step in a bigger effort to replace dive-site UUIDs by pointers. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-29Dive site: remove UUIDs from LocationInformationModelGravatar Berthold Stoeger
Replace UUIDs from LocationInformationModel and fix the fallout. Notably, replace the UUID "column" by a DIVESITE "column". Getting pointers through Qt's QVariant is horrible, we'll have to think about a better solution. RECENTLY_ADDED_DIVESITE now defines to a special pointer to struct dive_site (defined as ~0). This fixes an interesting logic bug: The old code checked the uuid of the LocationInformationModel (currUuid) for the value "1", which corresponded to RECENTLY_ADDED_DIVESITE. If equal, currType would be set to NEW_DIVE_SITE. Later, _currType_ was compared against _RECENTLY_ADDED_DIVESITE_. This would only work because NEW_DIVE_SITE and RECENTLY_ADDED_DIVESITE both were defined as 1. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-29Dive site: remove argument from diveSiteSelected signalGravatar Berthold Stoeger
The diveSiteSelected signal of DiveLocationLineEdit had the dive-site UUID as argument. But the receiving slot would not use that argument. Remove this as a tiny step to remove the UUIDs alltogether. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-29Dive site: replace UUID_ROLE by DIVESITE_ROLEGravatar Berthold Stoeger
Access to dive-sites in the LocationInformationModel was via UUID. Replace this by a direct access to the struct dive_site pointer. Accordingly, rename the UUID_ROLE to DIVESITE_ROLE. This is a small step in replacing dive-site UUIDs by pointers throughout the code base. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-29Dive site: use pointer instead of uuid in uemis_helperGravatar Berthold Stoeger
Another small step in removing dive-site UUIDs: use a pointer instead of a UUID in the "uemis_helper" structure. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-29Dive site: pass dive-site pointers to merge_dive_sites()Gravatar Berthold Stoeger
Instead of passing uuids, pass a pointer to the dive site. This is small step in an effort to remove uuids. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-29Dive site: pass dive-site pointer to delete_dive_site()Gravatar Berthold Stoeger
Instead of passing a uuid, pass a pointer to the dive site. This is small step in an effort to remove uuids. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-29Dive site: pass dive-site pointer to is_dive_site_used()Gravatar Berthold Stoeger
Instead of passing a uuid, pass a pointer to the dive site. This is small step in an effort to remove uuids. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-29Dive site: pass dive-site pointer to nr_of_dives_at_dive_site()Gravatar Berthold Stoeger
Instead of passing a uuid, pass a pointer to the dive site. This is small step in an effort to remove uuids. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-29Dive site: return pointer to dive_site in create_dive_site_*()Gravatar Berthold Stoeger
This changes more of the dive-site interface to return pointers instead of UUIDs. Currently, most call sites directly extract UUIDs afterwards. Ultimately, the UUIDs will be generally replaced by pointers, which will then simplify these callers. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-29Dive site: remove uuid in Uemis' divesite-mapGravatar Berthold Stoeger
The uemis downloader uses a cache for location to divesite id. Trivially, the divesite-uuid can be replaced by a pointer. This is a tiny step to remove divesite UUIDs. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-29Dive site: return pointer to dive_site in get_dive_site_*()Gravatar Berthold Stoeger
As a first step in removing dive-site uuids, change the interface of the get_dive_site_*() functions to return pointers instead of uuids. This makes code a bit more complicated in places where the uuid is extracted afterwards (needed NULL check). Nevertheless, these places should disappear once pointers instead of uuids are stored in the dive-structures. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-28std99 does not make sense for C++Gravatar Robert C. Helling
... and makes Qt Creator fail to parse files. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-10-28Dive list: remove rememberSelection() without restoreSelection()Gravatar Berthold Stoeger
Remove three cases of rememberSelection() which did not possess the corresponding restoreSelection() twins. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-28Dive list: remember/restore selection only on view changeGravatar Berthold Stoeger
The selection was remembered/restored anytime the sort-order changed. Yet, this is only necessary if the view (tree, list) changes. Therefore, handle the selection only if this is the case. This automatically fixes the problem of the trip-selection not being remembered if the view doesn't change. If the view does change, trip selection is lost. But since the list view doesn't have trips to start with, losing trip-selection seems like an understandable behavior. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-28Dive list: show sort indicatorGravatar Berthold Stoeger
On desktop, show the a sort indicator to give a visual feedback on changes of the sort order. This is trivially done by calling the setSortIndicatorShown() function in DiveListView's constructor. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-28Dive list: switch to a default sort order on column-header clickGravatar Berthold Stoeger
On desktop, clicking on a column header sorts the dive-list. This has the interesting property that every click reverses the sort order (unless changing from list to tree-mode). The much more common idiom seems to be to define a default sort order for each column and switch to that when changing sort-column. Switch order after clicking the same column again. Implement this more common behavior. For now, sort # and date in descending, all other columns in ascending order. While doing this, use the proper enum (NR) for setting the default sort-column instead of its integer representation (0). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-28Cleanup: remove DiveTripModel::layout() functionGravatar Berthold Stoeger
This accessor was never used. This is a small step in splitting the DiveTripModel in two (list & tree), which means that the layout is moved up to the view. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-27build-system: switch back to upstream qt-android-cmakeGravatar Dirk Hohndel
And in the process use our script to do the work. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-27QML UI: we don't need Controls 2.4Gravatar Dirk Hohndel
In commit 99c06dec3d ("Mobile/filtering: simple busy indicator") we switched to Controls 2.4 which requires Qt 5.11. Revert that one line of the commit as it isn't necessary. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-27qPref: reduce recompiles with every commitGravatar Dirk Hohndel
Including ssrf-version.h in an include file that a lot of files depend on caused a ton of unnecessary recompiles with every commit. This should reduce that problem. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-26Cleanup: remove declaration of unused signalGravatar Berthold Stoeger
The last use of the LocationInformation::startEditDiveSite() signal was removed in ff26ffe0d078a891cbc52afa7ffb59943644ad82. Remove its declaration. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-26Cleanup: remove dead code in qthelper.cppGravatar Berthold Stoeger
The reverseGeoLookup() function defined in qthelper.cpp has long ago moved to its own compilation unit. It is not even defined in the headers anymore. Remove it and the now unnecessary <QNetwork*> includes. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-25Update CHANGELOGGravatar Dirk Hohndel
This is of course an update that covers both this and the previous PR. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-25Mobile/filtering: update nr of dives shown in a trip when filteringGravatar Dirk Hohndel
Whenever the filter changes, simply walk the filtered dive list and ensure that we have the correct count for dives that match this filter. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-25core: use nr of dives shown in tripMeta infoGravatar Dirk Hohndel
When creating a trip header (as it is used in the mobile app right now), we need to show the number of dives shown, not the total number of dives in that trip. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-25core: add seperate number of dives shown to the trip structureGravatar Dirk Hohndel
We assume that any dive that gets added to a trip initially gets shown. The filter logic then needs to make sure it adjusts this number (which then makes it easy to tell the user how many dives of that trip are visible with the current filter). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-25core: add ability to get underlying dive to DiveObjectHelperGravatar Dirk Hohndel
This feels a bit like cheating, but if we need to be able to make modifications to the underlying dive and only have the helper object (for example inside of a view model), doing everything through the helper object can turn into a real performance issue. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-25Dive list: emit selectionChanged signal in filterFinished()Gravatar Berthold Stoeger
In commit 9829e49815de1b81b5c9848b71eaa810faab2bcf the dive selection code was moved from the filter to the dive list. As a consequence of that change, the selectionChanged signal was not emitted anymore and therefore the map widget was not informed of the new dive site list. This had funky effects on the dive-site editing. Notably, changing the location would move the map, but not update the flag. Explicitly emit selectionChanged in filterFinished() to fix dive site editing. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-25Fix bug in for loop that can lead to segfaultGravatar Simeon
In case of big log files, where MAX_TANK_INFO is reached, tank_info[i] != NULL should be checked after i<MAX_TANK_INFO Signed-off-by: Simeon Geiger <simeon.geiger@gmail.com>
2018-10-24Show coordinates if no tags from reverse geolookupGravatar Miika Turkia
This will display the dive site coordinates after the Location label if there are no associated tags from reverse geolookup. Thus it'll be clearer for users that we do have GPS location stored for the dive, and might be able to see more easily if the recorded coordinates are correct. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-10-23Mobile/filtering: make busy indicator smallerGravatar Dirk Hohndel
Suggested-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: update number of dives shown when resetting filterGravatar Dirk Hohndel
Otherwise we start showing an illogical '0' there when first opening the filter dialog, and the equally wrong previous count when closing and then re-opening the filter dialog. Reported-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: roll our own filtering for performance reasonsGravatar Dirk Hohndel
The regular expression based generic filtering made things very slow on a cell phone or other, slower device. With this the results seem more reasonable. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23QML UI: remove some of the log file noiseGravatar Dirk Hohndel
A couple came from this series, others are much older. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: show a better message while waiting for the filterGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: implement the filter update through a threadGravatar Dirk Hohndel
It's important to disconnect the model from the ListView, otherwise the update in a different thread will fail. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: remove redundant busy indicator on dive listGravatar Dirk Hohndel
We should use the global one instead. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: simplify the filter toggleGravatar Dirk Hohndel
Simply make it always reset the filter. There's no point remembering the last filter pattern and explicitly setting it, if the last thing we do is to reset this pattern. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: update filter in separate threadGravatar Dirk Hohndel
We can't use that while the model is shown, which is why this isn't hooked up. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: add properties for dive list model and filter textGravatar Dirk Hohndel
This allows us to modify those from different parts of the code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23QML UI: add busy indicator to the main windowGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23QML UI: make the QML window object part of the QMLManager classGravatar Dirk Hohndel
This way we can access it from that code (which we'll need to invoke methods in QML code from C++). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Cleanup: remove attempt to set long gone propertyGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: clean up whitespace from last commitGravatar Dirk Hohndel
This one does nothing but whitespace - separating it into two commits makes the previous one a lot easier to read. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: add background rectangle for filter rowGravatar Dirk Hohndel
We are still trying to ensure that the filter is indeed shown in front of the dive list. This is working when running on the desktop without the rectangle, but on Android this appears to be needed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: simplify transitionsGravatar Dirk Hohndel
We don't need to toggle visibility, toggling height is sufficient. This dramatically simplifies the transitions. But as a result we need to use the 'enabled' property to reset the filter. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: simple busy indicatorGravatar Dirk Hohndel
Filtering takes a noticeable time on mobile, so lets show the user we are doing something. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: finally implement the new settings in the actual filterGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: add fullTextNoNotes role to the dive list modelGravatar Dirk Hohndel
This way we can filter with and without the notes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>