From 3fb39cbb5944a0875255f7776e29e5d4518efbcc Mon Sep 17 00:00:00 2001 From: gaelle Date: Wed, 7 Jan 2026 16:04:16 +0100 Subject: [PATCH] fix transfer message chat list again #LINQT-2246 --- Linphone/core/chat/ChatList.cpp | 2 +- Linphone/core/chat/ChatProxy.cpp | 2 ++ Linphone/view/Control/Display/Chat/ChatListView.qml | 1 - Linphone/view/Page/Main/Chat/ChatPage.qml | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Linphone/core/chat/ChatList.cpp b/Linphone/core/chat/ChatList.cpp index 7f73dbb66..4c32c990a 100644 --- a/Linphone/core/chat/ChatList.cpp +++ b/Linphone/core/chat/ChatList.cpp @@ -50,7 +50,7 @@ ChatList::ChatList(QObject *parent) : ListProxy(parent) { ChatList::~ChatList() { mustBeInMainThread("~" + getClassName()); - mModelConnection = nullptr; + mModelConnection->disconnect(); } void ChatList::connectItem(QSharedPointer chat) { diff --git a/Linphone/core/chat/ChatProxy.cpp b/Linphone/core/chat/ChatProxy.cpp index cd01ee842..2042dc553 100644 --- a/Linphone/core/chat/ChatProxy.cpp +++ b/Linphone/core/chat/ChatProxy.cpp @@ -26,6 +26,8 @@ DEFINE_ABSTRACT_OBJECT(ChatProxy) ChatProxy::ChatProxy(QObject *parent) { + mList = ChatList::create(); + setSourceModel(mList.get()); } ChatProxy::~ChatProxy() { diff --git a/Linphone/view/Control/Display/Chat/ChatListView.qml b/Linphone/view/Control/Display/Chat/ChatListView.qml index 75d3dfba2..c54f965da 100644 --- a/Linphone/view/Control/Display/Chat/ChatListView.qml +++ b/Linphone/view/Control/Display/Chat/ChatListView.qml @@ -40,7 +40,6 @@ ListView { model: ChatProxy { id: chatProxy filterText: mainItem.searchText - model: AppCpp.chats onFilterTextChanged: { chatToSelectLater = currentChatGui } diff --git a/Linphone/view/Page/Main/Chat/ChatPage.qml b/Linphone/view/Page/Main/Chat/ChatPage.qml index 9132e61c5..58ba9f692 100644 --- a/Linphone/view/Page/Main/Chat/ChatPage.qml +++ b/Linphone/view/Page/Main/Chat/ChatPage.qml @@ -212,6 +212,7 @@ AbstractMainPage { id: chatListView Layout.fillWidth: true Layout.fillHeight: true + chatProxy.model: AppCpp.chats Layout.topMargin: Utils.getSizeWithScreenRatio(39) searchBar: searchBar Control.ScrollBar.vertical: scrollbar