mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Maintain opened the trips of the selected dive.
In various occasions the branches of selected dives got collapsed because I'm dummy boy and didn't programmed the logic correctly. This one correctly works for the few cases that I'v tried, I'm verifying if the current selected index is a trip or a dive, and asking to expand it. The expanded state is lost because we delete and recreate the model ( and we do that because we can switch between tree and table model ). Now I think we correctly track the cornercases. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
1e63579cc6
commit
bae41ddafb
1 changed files with 9 additions and 3 deletions
|
@ -274,9 +274,15 @@ void DiveListView::reload(DiveTripModel::Layout layout, bool forceSort)
|
|||
}
|
||||
}
|
||||
setupUi();
|
||||
QModelIndex curr = selectionModel()->currentIndex();
|
||||
if (curr.parent().isValid() && !isExpanded(curr.parent()))
|
||||
expand(curr.parent());
|
||||
if(selectedIndexes().count()){
|
||||
QModelIndex curr = selectedIndexes().first();
|
||||
curr = curr.parent().isValid() ? curr.parent() : curr;
|
||||
if(!isExpanded(curr)){
|
||||
setAnimated(false);
|
||||
expand(curr);
|
||||
setAnimated(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DiveListView::reloadHeaderActions()
|
||||
|
|
Loading…
Reference in a new issue