1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-08-03 14:25:38 +02:00

callview: fix conversation selection when call ends

- avoid using smartlist index change for conversation selection
when call ends (instead it can be triggered from calladapter)
- break long lines

Gitlab: #260

Change-Id: Iaa1f9269d9ba6889fb1a7e466cd586fa86263bc7
This commit is contained in:
ababi 2021-01-20 14:40:05 +01:00 committed by Andreas Traczyk
parent f27f4374a2
commit 59c8a75cc3
4 changed files with 13 additions and 13 deletions

View file

@ -392,6 +392,7 @@ CallAdapter::connectCallModel(const QString& accountId)
case lrc::api::call::Status::TIMEOUT:
case lrc::api::call::Status::TERMINATING: {
lrcInstance_->renderer()->removeDistantRenderer(callId);
emit callSetupMainViewRequired(accountId, convInfo.uid);
if (convInfo.uid.isEmpty()) {
break;
}
@ -424,9 +425,8 @@ CallAdapter::connectCallModel(const QString& accountId)
/*
* Reset the call view corresponding accountId, uid.
*/
lrcInstance_->setSelectedConvId(otherConv.uid);
updateCall(otherConv.uid, otherConv.accountId, forceCallOnly);
emit callSetupMainViewRequired(accountId, convInfo.uid);
}
}
}
@ -451,8 +451,6 @@ CallAdapter::connectCallModel(const QString& accountId)
default:
break;
}
emit lrcInstance_->updateSmartList();
});
remoteRecordingChangedConnection_ = QObject::connect(

View file

@ -192,7 +192,6 @@ ConversationsAdapter::connectConversationModel(bool updateFilter)
currentConversationModel, &lrc::api::ConversationModel::modelChanged, [this]() {
conversationSmartListModel_->fillConversationsList();
updateConversationsFilterWidget();
emit updateListViewRequested();
auto* convModel = lrcInstance_->getCurrentConversationModel();
const auto& convInfo = lrcInstance_->getConversationFromConvUid(
@ -257,7 +256,7 @@ ConversationsAdapter::connectConversationModel(bool updateFilter)
&lrc::api::ConversationModel::conversationCleared,
[this](const QString& convUid) {
// If currently selected, switch to welcome screen (deselecting
// current smartlist item ).
// current smartlist item).
if (convUid != lrcInstance_->getCurrentConvUid()) {
return;
}

View file

@ -42,6 +42,8 @@ ListView {
}
function repositionIndex(uid = "") {
// Only update index if it has changed
var currentI = root.currentIndex
if (uid === "")
uid = mainView.currentConvUID
root.currentIndex = -1

View file

@ -41,12 +41,11 @@ ItemDelegate {
Connections {
target: conversationSmartListView
// Hack, make sure that smartListItemDelegate does not show extra item
// when searching new contacts.
function onForceUpdatePotentialInvalidItem() {
smartListItemDelegate.visible = conversationSmartListView.model.rowCount(
) <= index ? false : true
smartListItemDelegate.visible =
conversationSmartListView.model.rowCount() <= index ? false : true
}
@ -123,8 +122,9 @@ ItemDelegate {
id: textMetricsConversationSmartListUserName
font: conversationSmartListUserName.font
elide: Text.ElideRight
elideWidth: LastInteractionDate ? (smartListItemDelegate.width - lastInteractionPreferredWidth - conversationSmartListUserImage.width-32) :
smartListItemDelegate.width - lastInteractionPreferredWidth
elideWidth: LastInteractionDate ? (smartListItemDelegate.width - lastInteractionPreferredWidth
- conversationSmartListUserImage.width-32)
: smartListItemDelegate.width - lastInteractionPreferredWidth
text: DisplayName === undefined ? "" : DisplayName
}
text: textMetricsConversationSmartListUserName.elidedText
@ -161,8 +161,9 @@ ItemDelegate {
id: textMetricsConversationSmartListUserLastInteractionMessage
font: conversationSmartListUserLastInteractionMessage.font
elide: Text.ElideRight
elideWidth: LastInteractionDate ? (smartListItemDelegate.width - lastInteractionPreferredWidth - conversationSmartListUserImage.width-32) :
smartListItemDelegate.width - lastInteractionPreferredWidth
elideWidth: LastInteractionDate ? (smartListItemDelegate.width - lastInteractionPreferredWidth
- conversationSmartListUserImage.width-32)
: smartListItemDelegate.width - lastInteractionPreferredWidth
text: InCall ? UtilsAdapter.getCallStatusStr(CallState) : (Draft ? Draft : LastInteraction)
}