Skip to content
Snippets Groups Projects
Commit 982996e3 authored by Stepan Salenikovich's avatar Stepan Salenikovich
Browse files

improve selection behaviour in RecentModel

When the CallModel selection is cleared, check if there is still a
call selected in the RecentModel; if so, then select that call in
the CallModel so that the UserActionModel is updated correctly.

Change-Id: Ie8262762ad28865ea454f4dba21111fa9501f2e7
Tuleap: #1072
parent b909204b
Branches
No related tags found
No related merge requests found
...@@ -1091,12 +1091,18 @@ RecentModelPrivate::slotCurrentCallChanged(const QModelIndex &current, const QMo ...@@ -1091,12 +1091,18 @@ RecentModelPrivate::slotCurrentCallChanged(const QModelIndex &current, const QMo
q_ptr->selectionModel()->setCurrentIndex(callIdx, QItemSelectionModel::ClearAndSelect); q_ptr->selectionModel()->setCurrentIndex(callIdx, QItemSelectionModel::ClearAndSelect);
else else
q_ptr->selectionModel()->setCurrentIndex(callIdx.parent(), QItemSelectionModel::ClearAndSelect); q_ptr->selectionModel()->setCurrentIndex(callIdx.parent(), QItemSelectionModel::ClearAndSelect);
} else {
/* nothing is selected in the CallModel; however, if we still have a call selected in the
* RecentModel, we need to select it in the CallModel, or else all the actions of the call
* will be invalid, since the UserActionModel is based on the selection of the CallModel */
auto recentIdx = q_ptr->selectionModel()->currentIndex();
auto recentCall = q_ptr->getActiveCall(recentIdx);
if (recentIdx.isValid() && recentCall) {
CallModel::instance().selectCall(recentCall);
}
/* otherwise do not update the selection in the RecentModel, eg: if a Person was selected
* and the Call is over, we still want the Person to be selected */
} }
/* do not update the selection in the RecentModel if no calls selected in the CallModel;
* eg: if a Call was selected in the RecentModel, when its removed, the seleciton will
* change automatically, so no action is needed;
* if a Person was selected and the Call is over, we still want the Person to be selected;
*/
} }
///Filter out every data relevant to a person ///Filter out every data relevant to a person
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment