diff --git a/src/recentmodel.cpp b/src/recentmodel.cpp index c689765ce2191e2fc323ad0c9320ab799e07e624..acb17c4896fd4ead1c6b60f215c956716d2faa68 100644 --- a/src/recentmodel.cpp +++ b/src/recentmodel.cpp @@ -782,8 +782,15 @@ RecentModelPrivate::insertCallNode(RecentViewNode *parent, RecentViewNode* callN emit q_ptr->dataChanged(firstChild, firstChild); } - // Select the newly inserted call - q_ptr->selectionModel()->setCurrentIndex(q_ptr->index(callNode->m_Index, 0), QItemSelectionModel::ClearAndSelect); + /* in the case of a conference, we select the call; + * in case the parent only has one call, we select the parent; + * in case the parent has multiple calls, we select the call; + */ + auto callIdx = q_ptr->index(callNode->m_Index, 0, parentIdx); + if (q_ptr->isConference(callIdx) || q_ptr->isConference(parentIdx) || q_ptr->rowCount(parentIdx) > 1) + q_ptr->selectionModel()->setCurrentIndex(callIdx, QItemSelectionModel::ClearAndSelect); + else + q_ptr->selectionModel()->setCurrentIndex(callIdx.parent(), QItemSelectionModel::ClearAndSelect); } void