diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-08-14 09:12:21 -0400 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-10-11 16:22:27 -0700 |
commit | 3c6cdfd8c02e215f98986cbb74b33f58e47fe632 (patch) | |
tree | 206a1eb2bb427df36abe4b08160673dde9bf667b /desktop-widgets/command_divelist.cpp | |
parent | b16be29595f09daa422c2c07075d3b8b60e7fad9 (diff) | |
download | subsurface-3c6cdfd8c02e215f98986cbb74b33f58e47fe632.tar.gz |
Dive list: propagate current-item to frontend
The command-objects select a current item, but this selection
was not propagated to the front-end. The current item is the
base for keyboard-navigation through the dive-list and therefore
should be set correctly.
It took some experimentation to get the flags right:
QItemSelectionModel::Current
Hopefully, these are the correct flags across all supported
Qt versions!
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/command_divelist.cpp')
-rw-r--r-- | desktop-widgets/command_divelist.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/desktop-widgets/command_divelist.cpp b/desktop-widgets/command_divelist.cpp index d3ecfb796..7fbda35dc 100644 --- a/desktop-widgets/command_divelist.cpp +++ b/desktop-widgets/command_divelist.cpp @@ -423,7 +423,12 @@ void DiveListBase::restoreSelection(const std::vector<dive *> &selection, dive * }); bool currentDiveChanged = false; - if (current_dive != currentDive) { + // If currentDive is null, we have no current dive. In such a case always + // signal the frontend. + if (!currentDive) { + currentDiveChanged = true; + emit diveListNotifier.currentDiveChanged(); + } else if (current_dive != currentDive) { currentDiveChanged = true; // We cannot simply change the currentd dive to the given dive. |