mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-18 03:48:09 +00:00
remove connect already in QSortFilterProxyModel (leading to crash in Windows)
This commit is contained in:
parent
f8a4f73993
commit
94df04c347
3 changed files with 6 additions and 7 deletions
|
|
@ -93,15 +93,17 @@ void ChatList::setSelf(QSharedPointer<ChatList> me) {
|
|||
return;
|
||||
}
|
||||
setIsUpdating(true);
|
||||
beginResetModel();
|
||||
mModelConnection->invokeToModel([this]() {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
beginResetModel();
|
||||
// Avoid copy to lambdas
|
||||
QList<QSharedPointer<ChatCore>> *chats = new QList<QSharedPointer<ChatCore>>();
|
||||
auto currentAccount = CoreModel::getInstance()->getCore()->getDefaultAccount();
|
||||
if (!currentAccount) {
|
||||
setIsUpdating(false);
|
||||
endResetModel();
|
||||
mModelConnection->invokeToCore([this, chats]() {
|
||||
setIsUpdating(false);
|
||||
endResetModel();
|
||||
});
|
||||
return;
|
||||
}
|
||||
auto linphoneChatRooms = currentAccount->filterChatRooms(Utils::appStringToCoreString(mFilter));
|
||||
|
|
@ -122,8 +124,8 @@ void ChatList::setSelf(QSharedPointer<ChatList> me) {
|
|||
mList.clear();
|
||||
for (auto &chat : *chats) {
|
||||
connectItem(chat);
|
||||
mList.append(chat);
|
||||
}
|
||||
add(*chats);
|
||||
endResetModel();
|
||||
setIsUpdating(false);
|
||||
delete chats;
|
||||
|
|
|
|||
|
|
@ -47,8 +47,6 @@ void ChatProxy::setSourceModel(QAbstractItemModel *model) {
|
|||
[this, newChatList] { emit newChatList->filterChanged(getFilterText()); });
|
||||
connect(newChatList, &ChatList::chatAdded, this, [this] { invalidate(); });
|
||||
connect(newChatList, &ChatList::dataChanged, this, [this] { invalidate(); });
|
||||
connect(newChatList, &ChatList::modelAboutToBeReset, this, &ChatProxy::modelAboutToBeReset);
|
||||
connect(newChatList, &ChatList::modelReset, this, &ChatProxy::modelReset);
|
||||
}
|
||||
QSortFilterProxyModel::setSourceModel(newChatList);
|
||||
sort(0);
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@ ListView {
|
|||
mainItem.currentIndex = index
|
||||
}
|
||||
|
||||
Component.onCompleted: cacheBuffer = Math.max(contentHeight, 0) //contentHeight>0 ? contentHeight : 0// cache all items
|
||||
// remove binding loop
|
||||
onContentHeightChanged: Qt.callLater(function () {
|
||||
if (mainItem)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue