mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-05 23:35:50 +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:
parent
f27f4374a2
commit
59c8a75cc3
4 changed files with 13 additions and 13 deletions
|
@ -392,6 +392,7 @@ CallAdapter::connectCallModel(const QString& accountId)
|
||||||
case lrc::api::call::Status::TIMEOUT:
|
case lrc::api::call::Status::TIMEOUT:
|
||||||
case lrc::api::call::Status::TERMINATING: {
|
case lrc::api::call::Status::TERMINATING: {
|
||||||
lrcInstance_->renderer()->removeDistantRenderer(callId);
|
lrcInstance_->renderer()->removeDistantRenderer(callId);
|
||||||
|
emit callSetupMainViewRequired(accountId, convInfo.uid);
|
||||||
if (convInfo.uid.isEmpty()) {
|
if (convInfo.uid.isEmpty()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -424,9 +425,8 @@ CallAdapter::connectCallModel(const QString& accountId)
|
||||||
/*
|
/*
|
||||||
* Reset the call view corresponding accountId, uid.
|
* Reset the call view corresponding accountId, uid.
|
||||||
*/
|
*/
|
||||||
|
lrcInstance_->setSelectedConvId(otherConv.uid);
|
||||||
updateCall(otherConv.uid, otherConv.accountId, forceCallOnly);
|
updateCall(otherConv.uid, otherConv.accountId, forceCallOnly);
|
||||||
|
|
||||||
emit callSetupMainViewRequired(accountId, convInfo.uid);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -451,8 +451,6 @@ CallAdapter::connectCallModel(const QString& accountId)
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
emit lrcInstance_->updateSmartList();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
remoteRecordingChangedConnection_ = QObject::connect(
|
remoteRecordingChangedConnection_ = QObject::connect(
|
||||||
|
|
|
@ -192,7 +192,6 @@ ConversationsAdapter::connectConversationModel(bool updateFilter)
|
||||||
currentConversationModel, &lrc::api::ConversationModel::modelChanged, [this]() {
|
currentConversationModel, &lrc::api::ConversationModel::modelChanged, [this]() {
|
||||||
conversationSmartListModel_->fillConversationsList();
|
conversationSmartListModel_->fillConversationsList();
|
||||||
updateConversationsFilterWidget();
|
updateConversationsFilterWidget();
|
||||||
emit updateListViewRequested();
|
|
||||||
|
|
||||||
auto* convModel = lrcInstance_->getCurrentConversationModel();
|
auto* convModel = lrcInstance_->getCurrentConversationModel();
|
||||||
const auto& convInfo = lrcInstance_->getConversationFromConvUid(
|
const auto& convInfo = lrcInstance_->getConversationFromConvUid(
|
||||||
|
@ -257,7 +256,7 @@ ConversationsAdapter::connectConversationModel(bool updateFilter)
|
||||||
&lrc::api::ConversationModel::conversationCleared,
|
&lrc::api::ConversationModel::conversationCleared,
|
||||||
[this](const QString& convUid) {
|
[this](const QString& convUid) {
|
||||||
// If currently selected, switch to welcome screen (deselecting
|
// If currently selected, switch to welcome screen (deselecting
|
||||||
// current smartlist item ).
|
// current smartlist item).
|
||||||
if (convUid != lrcInstance_->getCurrentConvUid()) {
|
if (convUid != lrcInstance_->getCurrentConvUid()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,8 @@ ListView {
|
||||||
}
|
}
|
||||||
|
|
||||||
function repositionIndex(uid = "") {
|
function repositionIndex(uid = "") {
|
||||||
|
// Only update index if it has changed
|
||||||
|
var currentI = root.currentIndex
|
||||||
if (uid === "")
|
if (uid === "")
|
||||||
uid = mainView.currentConvUID
|
uid = mainView.currentConvUID
|
||||||
root.currentIndex = -1
|
root.currentIndex = -1
|
||||||
|
|
|
@ -41,12 +41,11 @@ ItemDelegate {
|
||||||
Connections {
|
Connections {
|
||||||
target: conversationSmartListView
|
target: conversationSmartListView
|
||||||
|
|
||||||
|
|
||||||
// Hack, make sure that smartListItemDelegate does not show extra item
|
// Hack, make sure that smartListItemDelegate does not show extra item
|
||||||
// when searching new contacts.
|
// when searching new contacts.
|
||||||
function onForceUpdatePotentialInvalidItem() {
|
function onForceUpdatePotentialInvalidItem() {
|
||||||
smartListItemDelegate.visible = conversationSmartListView.model.rowCount(
|
smartListItemDelegate.visible =
|
||||||
) <= index ? false : true
|
conversationSmartListView.model.rowCount() <= index ? false : true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -123,8 +122,9 @@ ItemDelegate {
|
||||||
id: textMetricsConversationSmartListUserName
|
id: textMetricsConversationSmartListUserName
|
||||||
font: conversationSmartListUserName.font
|
font: conversationSmartListUserName.font
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
elideWidth: LastInteractionDate ? (smartListItemDelegate.width - lastInteractionPreferredWidth - conversationSmartListUserImage.width-32) :
|
elideWidth: LastInteractionDate ? (smartListItemDelegate.width - lastInteractionPreferredWidth
|
||||||
smartListItemDelegate.width - lastInteractionPreferredWidth
|
- conversationSmartListUserImage.width-32)
|
||||||
|
: smartListItemDelegate.width - lastInteractionPreferredWidth
|
||||||
text: DisplayName === undefined ? "" : DisplayName
|
text: DisplayName === undefined ? "" : DisplayName
|
||||||
}
|
}
|
||||||
text: textMetricsConversationSmartListUserName.elidedText
|
text: textMetricsConversationSmartListUserName.elidedText
|
||||||
|
@ -161,8 +161,9 @@ ItemDelegate {
|
||||||
id: textMetricsConversationSmartListUserLastInteractionMessage
|
id: textMetricsConversationSmartListUserLastInteractionMessage
|
||||||
font: conversationSmartListUserLastInteractionMessage.font
|
font: conversationSmartListUserLastInteractionMessage.font
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
elideWidth: LastInteractionDate ? (smartListItemDelegate.width - lastInteractionPreferredWidth - conversationSmartListUserImage.width-32) :
|
elideWidth: LastInteractionDate ? (smartListItemDelegate.width - lastInteractionPreferredWidth
|
||||||
smartListItemDelegate.width - lastInteractionPreferredWidth
|
- conversationSmartListUserImage.width-32)
|
||||||
|
: smartListItemDelegate.width - lastInteractionPreferredWidth
|
||||||
text: InCall ? UtilsAdapter.getCallStatusStr(CallState) : (Draft ? Draft : LastInteraction)
|
text: InCall ? UtilsAdapter.getCallStatusStr(CallState) : (Draft ? Draft : LastInteraction)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue