Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
31321a4d
Commit
31321a4d
authored
Nov 30, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(src/components/chat/ChatProxyModel): fix `loadMoreEntries` to support the switch between views
parent
b08682a3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
ChatProxyModel.cpp
tests/src/components/chat/ChatProxyModel.cpp
+11
-9
No files found.
tests/src/components/chat/ChatProxyModel.cpp
View file @
31321a4d
...
@@ -32,18 +32,20 @@ ChatProxyModel::ChatProxyModel (QObject *parent) : QSortFilterProxyModel(parent)
...
@@ -32,18 +32,20 @@ ChatProxyModel::ChatProxyModel (QObject *parent) : QSortFilterProxyModel(parent)
}
}
void
ChatProxyModel
::
loadMoreEntries
()
{
void
ChatProxyModel
::
loadMoreEntries
()
{
int
count
=
rowCount
();
int
parent_count
=
m_chat_model_filter
.
rowCount
();
if
(
count
<
parent_count
)
{
// Do not increase `m_n_max_displayed_entries` if it's not necessary...
// Do not increase `m_n_max_displayed_entries` if it's not necessary...
// Limit qml calls.
// Limit qml calls.
if
(
m_chat_model_filter
.
rowCount
()
<=
m_n_max_displayed_entries
)
if
(
count
==
m_n_max_displayed_entries
)
return
;
int
count
=
rowCount
();
m_n_max_displayed_entries
+=
ENTRIES_CHUNK_SIZE
;
m_n_max_displayed_entries
+=
ENTRIES_CHUNK_SIZE
;
invalidateFilter
();
invalidateFilter
();
if
(
count
<
rowCount
())
if
(
count
<
rowCount
())
emit
moreEntriesLoaded
();
emit
moreEntriesLoaded
();
}
}
}
void
ChatProxyModel
::
setEntryTypeFilter
(
ChatModel
::
EntryType
type
)
{
void
ChatProxyModel
::
setEntryTypeFilter
(
ChatModel
::
EntryType
type
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment