mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-29 22:56:22 +00:00
fix(src/components/chat/ChatProxyModel): fix loadMoreEntries to support the switch between views
This commit is contained in:
parent
b08682a3dd
commit
31321a4db7
1 changed files with 11 additions and 9 deletions
|
|
@ -32,18 +32,20 @@ ChatProxyModel::ChatProxyModel (QObject *parent) : QSortFilterProxyModel(parent)
|
|||
}
|
||||
|
||||
void ChatProxyModel::loadMoreEntries () {
|
||||
// Do not increase `m_n_max_displayed_entries` if it's not necessary...
|
||||
// Limit qml calls.
|
||||
if (m_chat_model_filter.rowCount() <= m_n_max_displayed_entries)
|
||||
return;
|
||||
|
||||
int count = rowCount();
|
||||
m_n_max_displayed_entries += ENTRIES_CHUNK_SIZE;
|
||||
int parent_count = m_chat_model_filter.rowCount();
|
||||
|
||||
invalidateFilter();
|
||||
if (count < parent_count) {
|
||||
// Do not increase `m_n_max_displayed_entries` if it's not necessary...
|
||||
// Limit qml calls.
|
||||
if (count == m_n_max_displayed_entries)
|
||||
m_n_max_displayed_entries += ENTRIES_CHUNK_SIZE;
|
||||
|
||||
if (count < rowCount())
|
||||
emit moreEntriesLoaded();
|
||||
invalidateFilter();
|
||||
|
||||
if (count < rowCount())
|
||||
emit moreEntriesLoaded();
|
||||
}
|
||||
}
|
||||
|
||||
void ChatProxyModel::setEntryTypeFilter (ChatModel::EntryType type) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue