mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-30 16:06:24 +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;
|
mIsInitialized = true;
|
||||||
if(entries.size() >0){
|
if(entries.size() >0){
|
||||||
beginInsertRows(QModelIndex(), 0, entries.size()-1);
|
beginResetModel();
|
||||||
mEntries = entries;
|
mEntries = entries;
|
||||||
endInsertRows();
|
endResetModel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -181,7 +181,10 @@ bool ChatRoomProxyModel::lessThan (const QModelIndex &left, const QModelIndex &r
|
||||||
b = r.value<ChatNoticeModel*>();
|
b = r.value<ChatNoticeModel*>();
|
||||||
if(!b)
|
if(!b)
|
||||||
b = r.value<ChatCallModel*>();
|
b = r.value<ChatCallModel*>();
|
||||||
|
if(!b)
|
||||||
|
return true;
|
||||||
|
if(!a)
|
||||||
|
return false;
|
||||||
return a->mTimestamp < b->mTimestamp;
|
return a->mTimestamp < b->mTimestamp;
|
||||||
}
|
}
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue