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
79853f99
Commit
79853f99
authored
Jan 11, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(src/components/chat/ChatProxyModel): increment properly visible messages number
parent
0988bb93
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
ChatModel.cpp
tests/src/components/chat/ChatModel.cpp
+2
-0
ChatModel.hpp
tests/src/components/chat/ChatModel.hpp
+2
-1
ChatProxyModel.cpp
tests/src/components/chat/ChatProxyModel.cpp
+14
-1
No files found.
tests/src/components/chat/ChatModel.cpp
View file @
79853f99
...
...
@@ -83,6 +83,8 @@ ChatModel::ChatModel (QObject *parent) : QAbstractListModel(parent) {
if
(
m_chat_room
==
message
->
getChatRoom
())
{
insertMessageAtEnd
(
message
);
m_chat_room
->
markAsRead
();
emit
messageReceived
(
message
);
}
}
);
...
...
tests/src/components/chat/ChatModel.hpp
View file @
79853f99
...
...
@@ -72,7 +72,8 @@ signals:
void
sipAddressChanged
(
const
QString
&
sip_address
);
void
allEntriesRemoved
();
void
messageSent
(
std
::
shared_ptr
<
linphone
::
ChatMessage
>
&
message
);
void
messageSent
(
const
std
::
shared_ptr
<
linphone
::
ChatMessage
>
&
message
);
void
messageReceived
(
const
std
::
shared_ptr
<
linphone
::
ChatMessage
>
&
message
);
private:
void
fillMessageEntry
(
...
...
tests/src/components/chat/ChatProxyModel.cpp
View file @
79853f99
...
...
@@ -27,6 +27,20 @@ const unsigned int ChatProxyModel::ENTRIES_CHUNK_SIZE = 50;
ChatProxyModel
::
ChatProxyModel
(
QObject
*
parent
)
:
QSortFilterProxyModel
(
parent
)
{
setSourceModel
(
&
m_chat_model_filter
);
ChatModel
*
chat
=
static_cast
<
ChatModel
*>
(
m_chat_model_filter
.
sourceModel
());
QObject
::
connect
(
chat
,
&
ChatModel
::
messageReceived
,
this
,
[
this
](
const
shared_ptr
<
linphone
::
ChatMessage
>
&
)
{
m_n_max_displayed_entries
++
;
}
);
QObject
::
connect
(
chat
,
&
ChatModel
::
messageSent
,
this
,
[
this
](
const
shared_ptr
<
linphone
::
ChatMessage
>
&
)
{
m_n_max_displayed_entries
++
;
}
);
}
void
ChatProxyModel
::
loadMoreEntries
()
{
...
...
@@ -42,7 +56,6 @@ void ChatProxyModel::loadMoreEntries () {
invalidateFilter
();
count
=
rowCount
()
-
count
;
if
(
count
>
0
)
emit
moreEntriesLoaded
(
count
);
}
...
...
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