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
36618bbc
Commit
36618bbc
authored
Jan 11, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(src/components/chat/ChatModel): use only one handlers instance
parent
d37559bb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
linphone
submodules/linphone
+1
-1
ChatModel.cpp
tests/src/components/chat/ChatModel.cpp
+4
-2
ChatModel.hpp
tests/src/components/chat/ChatModel.hpp
+1
-0
No files found.
linphone
@
6c4053d1
Subproject commit
fb3c9841ee5142d1826e2674591797343bd728ff
Subproject commit
6c4053d101a99ac574346ca7c5e35e2491d727dd
tests/src/components/chat/ChatModel.cpp
View file @
36618bbc
...
@@ -74,6 +74,8 @@ ChatModel::ChatModel (QObject *parent) : QAbstractListModel(parent) {
...
@@ -74,6 +74,8 @@ ChatModel::ChatModel (QObject *parent) : QAbstractListModel(parent) {
);
);
m_core_handlers
=
CoreManager
::
getInstance
()
->
getHandlers
();
m_core_handlers
=
CoreManager
::
getInstance
()
->
getHandlers
();
m_message_handlers
=
make_shared
<
MessageHandlers
>
(
this
);
QObject
::
connect
(
QObject
::
connect
(
&
(
*
m_core_handlers
),
&
CoreHandlers
::
receivedMessage
,
&
(
*
m_core_handlers
),
&
CoreHandlers
::
receivedMessage
,
this
,
[
this
](
this
,
[
this
](
...
@@ -236,8 +238,8 @@ void ChatModel::removeAllEntries () {
...
@@ -236,8 +238,8 @@ void ChatModel::removeAllEntries () {
void
ChatModel
::
sendMessage
(
const
QString
&
message
)
{
void
ChatModel
::
sendMessage
(
const
QString
&
message
)
{
shared_ptr
<
linphone
::
ChatMessage
>
_message
=
m_chat_room
->
createMessage
(
::
Utils
::
qStringToLinphoneString
(
message
));
shared_ptr
<
linphone
::
ChatMessage
>
_message
=
m_chat_room
->
createMessage
(
::
Utils
::
qStringToLinphoneString
(
message
));
_message
->
setListener
(
m
ake_shared
<
MessageHandlers
>
(
this
)
);
_message
->
setListener
(
m
_message_handlers
);
m_chat_room
->
send
Chat
Message
(
_message
);
m_chat_room
->
sendMessage
(
_message
);
insertMessageAtEnd
(
_message
);
insertMessageAtEnd
(
_message
);
}
}
...
...
tests/src/components/chat/ChatModel.hpp
View file @
36618bbc
...
@@ -96,6 +96,7 @@ private:
...
@@ -96,6 +96,7 @@ private:
std
::
shared_ptr
<
linphone
::
ChatRoom
>
m_chat_room
;
std
::
shared_ptr
<
linphone
::
ChatRoom
>
m_chat_room
;
std
::
shared_ptr
<
CoreHandlers
>
m_core_handlers
;
std
::
shared_ptr
<
CoreHandlers
>
m_core_handlers
;
std
::
shared_ptr
<
MessageHandlers
>
m_message_handlers
;
};
};
#endif // CHAT_MODEL_H_
#endif // CHAT_MODEL_H_
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