Age | Commit message (Collapse) | Author |
|
This function did not access any class members and was not used
outside the tranlation unit. Let's make it local (i.e. static)
to the translation unit.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
This member function was never used.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
The code is not used yet.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
This was basically random.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
After pressing CTRL-F let the user immediately enter a search
string.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
There are now three filter modes:
1) Dive site
2) Fulltext
3) Normal
When doing a fulltext search, get the dives that match the
fulltext filter and then apply the other filters on that list.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
When loading dive data, populate the fulltext index. When clearing
dive data, free the fulltext index. When deleting a dive, remove it
from the fulltext index.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
Add code that indexes all words of a dive and provides searching
for words.
A query is represented by the FullTextQuery class, which can be
initialized by assigning a string to it. It is basically a list
of words.
The result of a search is stored in the FullTextResult class,
which is a list of dives.
The actual indexing and searching is implemented in the FullText
class. However, this class is not exported because the interface
is partially accessible to C. Notably, the reloading of the
fulltext index is done from the C core.
Currently, the indexing and searching is totally unoptimized.
In a ~4000 dives test-log searches typically took single-digit
ms times. There is ample room for optimization (e.g. when
searching for multiple words, chose the words with few dives
first and when down to a few dives, check them individually).
The words of each dive are tokenized and uppercased and
cached with the dive. A pointer to these words is stashed
in the dive structure.
For now, compile only on desktop.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
The FilterData struct has the enum StringMode, which describes how
strings are searched (substring, startswith, exact). To make it
more generally accessible, remove it from the class. Since it is
an "enum class", the values don't pollute the global namespace anyway.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
Pull upstream libdivecomputer updates from Jef Driesen:
- fix lack of "end of deco" on DiveSystem iDive computers by reporting
long NDL values
- clean up handling of Oceanic empty logbugger
- fix BLE download for Oceanic Pro Plus X that doesn't like the serial
number handshake.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
No user of that.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
No user of that.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
No user of that.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
No users of those.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
No user of that.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
There were no users of these...?
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
These were used to remove warning-icons to mark tabs with user
changes. However these icons haven't been set since commit
a86aca037843167b26726926dbf2aebe0513afba.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
Convert to QString instead of a QByteArray. Use qPrintable()
instead of data(). This might do one more UTF16->UTF8 conversion.
However, this is completely irrelevant, since we don't change
the type of a cylinder in a tight loop.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
The C-string cyl->type.description was set without the old data
being freed. Free the old string before overwriting the pointer.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
The last outside use of the function was replaced by calls
to data().
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
The tank-info-delegate cast its model to CylindersModelFiltered,
since this is what the equipment-tab uses since implementing the
filtering of unused cylinders. However, the planner users the same
delegate and still uses the unfiltered CylindersModel. This means
that the (dynamic) cast returns a null pointer and crashes.
One possibility would be to derive CylindersModelFiltered and
CylindersModel from the same class that defines virtual functions
and cast to that class.
This is a different attempt: don't cast (i.e. stay with a
QAbstractItemModel and play it via Qt's model-view system. Firstly,
replace the passInData function by a role to setData(). Secondly,
read the working-pressure and size via new columns using data().
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
This is adapted from a conversation with Jef.
Suggested-by: Jef Driesen <jef@libdivecomputer.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
The updateDiveInfo() call updates all tabs. No need to do
it right afterwards.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
This was used to test whether the "really discard changes?"
message should be shown. However, we now edit weightsystems
directly with undo commands. Therefore, the check is unnecessary
and the whole function can be removed.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
This field was not set to true since introducing undo of
dive fields.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
This will seem too small to many - it's pushing it, but it leads to a
significantly less cluttered profile, and we now have the zoom capability for
readability.
I think this is a nice improvement.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
Several users still found the wait too long - this is near instantaneous it
just ignores brief taps.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
This header is a rebase artifact and introduces a pointless
column in the cylinder tables. It was erroneously introduced
in 6622f42aab937e72cc11cb5512012394aa687767.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
As of today some of the icons that we need are no longer in the git repoo but
instead created via script. Instead of making this work everywhere, let's just
use a working SHA...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
Nobody was ever listening to this signal(?) and the last sender
was removed in ac52034778bc5c82bb6c689d765b337b6d75b24a.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
The DiveFilter class defined the showDive() function to test
whether a dive should be filtered or not. This was used in
DiveTripModel to loop over all dives or all dives affected by
an editing action.
This restricts us in how we do filtering: We can't use indexes
that give us directly the result. To make the filtering more
flexible, move the actual loops that do the filtering to
the DiveFilter class.
The undo-commands likewise called directly the showDive()
function to check whether newly added dives are shown.
Use the new interface here as well.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
When changing the filter-criterion and the current dive is
hidden, a new dive is made current. However, when a dive is
hidden because it was edited, it is still shown.
Make this consistent by also selecing a new current dive
in the latter case. Do this by comparing the current_dive
before and after calculating the filter. Since this is now
done in multiple places move this code to the ShownChange
class.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
Since we now filter at the model level, items are by definition
shown. No need for a flag.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
This role was used by the filter-proxy model as filter criterion.
Since we don't use that model to filter anymore, we can remove
the role.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
This was used by the old filtering code. This is not necessary
anymore.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
Since we're doing the filtering at the core, don't filter
in the sort-model (which is now inappropriately named).
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
We use a QFilterProxyModel to filter out dives that are hidden
according to the current filter-criterion. Instead, filter the
dives already at the DiveTripModel level. Filter out hidden
dives immediately when receiving them. The only difficult case
is when dives are changed, because then visibility can change.
This means that we have three cases to consider:
1) Visibility unchanged -> send change signal
2) Change from hidden to unhidden -> add dives to model
3) Change from unhidden to hidden -> remove dives from model
Things get complicated by the fact that the tree-version of
the model might have to add/remove full trips!
Suggested-by: Dirk Hohndel <dirk@hohndel.org>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
In moveDiveToTrip(), the dive was first removed from its old trip
and then added to the new trip. This function is also used to
remove the dive from its trip (by moving it to the "null-trip"
if you whish). Even in that case add_dive_to_trip() was called.
The only reason why this didn't crash is that add_dive_to_trip()
checks whether old and new trip are the same. This is the case
when adding to the "null-trip", since the dive was removed from
the trip just before.
To cut a long story short, to trust on add_dive_to_trip() not
crashing if moving from the null-trip to the null-trip is
way to subtly. If we remove a dive from its trip, don't call
add_dive_to_trip() in the first place.
Reported-by: Dirk Hohndel <dirk@hohndel.org>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
Use the TemplateRadioButton to get the default styling - and by switching to the
RadioButton from Controls.2 we also get exclusivity by default.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
Replace passive voice 'one' with active voice 'you'. More strongly articulate
the limitations for FTDI / cable based downloads on mobile devices.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
This includes comments on how to zoom and pan the profile.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
When running mobile on desktop there are some odd jumps in the mouse position while in
drag mode (press and hold, then move). They make the user interface seem jerky.
But I haven't observed the same behavior on the mobile device when testing. So
I'm not sure what to do with that.
Using opacity to indicate that the user is able to pan the profile seems reasonably
obvious; not sure if it's the best possible way to do this.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
This will allow us to pan the profile around in the QML UI.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
In verbose mode we log how long it took us to render the profile.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
This allows us to trigger an update even if the dive displayed stays the same.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
This way we can clip the profile to it's designated size.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
One could argue that this should be a preference. I like the fact that it isn't
persistent, though.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
This should never have been merged as it was. The UI was atrocious and the
functionality was by and large untested.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|