mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-21 21:58:06 +00:00
Fix crash : chat room model need a reset on init() as elements are erased
This commit is contained in:
parent
ed13cc174b
commit
edec781e6f
2 changed files with 6 additions and 3 deletions
|
|
@ -739,9 +739,9 @@ void ChatRoomModel::initEntries(){
|
|||
|
||||
mIsInitialized = true;
|
||||
if(entries.size() >0){
|
||||
beginInsertRows(QModelIndex(), 0, entries.size()-1);
|
||||
beginResetModel();
|
||||
mEntries = entries;
|
||||
endInsertRows();
|
||||
endResetModel();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -181,7 +181,10 @@ bool ChatRoomProxyModel::lessThan (const QModelIndex &left, const QModelIndex &r
|
|||
b = r.value<ChatNoticeModel*>();
|
||||
if(!b)
|
||||
b = r.value<ChatCallModel*>();
|
||||
|
||||
if(!b)
|
||||
return true;
|
||||
if(!a)
|
||||
return false;
|
||||
return a->mTimestamp < b->mTimestamp;
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue