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
e6c45503
Commit
e6c45503
authored
Nov 22, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
not stable, crash with `mapSipAddressToContact`
parent
a20c32af
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
9 deletions
+16
-9
ContactsListModel.cpp
tests/src/components/contacts/ContactsListModel.cpp
+9
-3
ContactsListModel.hpp
tests/src/components/contacts/ContactsListModel.hpp
+2
-1
ContactsListProxyModel.cpp
tests/src/components/contacts/ContactsListProxyModel.cpp
+1
-1
TimelineModel.cpp
tests/src/components/timeline/TimelineModel.cpp
+3
-3
Timeline.qml
tests/ui/modules/Linphone/Timeline.qml
+1
-1
No files found.
tests/src/components/contacts/ContactsListModel.cpp
View file @
e6c45503
...
...
@@ -11,8 +11,10 @@ ContactsListModel::ContactsListModel (QObject *parent): QAbstractListModel(paren
shared_ptr
<
linphone
::
Core
>
core
(
CoreManager
::
getInstance
()
->
getCore
());
// Init contacts with linphone friends list.
for
(
auto
&&
contact
:
core
->
getFriendsLists
().
front
()
->
getFriends
())
{
m_list
<<
new
ContactModel
(
contact
);
for
(
const
auto
&
friend_
:
core
->
getFriendsLists
().
front
()
->
getFriends
())
{
ContactModel
*
contact
=
new
ContactModel
(
friend_
);
m_friend_to_contact
[
friend_
.
get
()]
=
contact
;
m_list
<<
contact
;
}
}
...
...
@@ -37,5 +39,9 @@ QVariant ContactsListModel::data (const QModelIndex &index, int role) const {
// -------------------------------------------------------------------
ContactModel
*
ContactsListModel
::
mapSipAddressToContact
(
const
QString
&
sipAddress
)
{
return
ContactsListProxyModel
::
getContactsListModel
()
->
m_list
.
front
();
return
m_friend_to_contact
[
CoreManager
::
getInstance
()
->
getCore
()
->
getFriendsLists
().
front
()
->
findFriendByUri
(
sipAddress
.
toStdString
()
).
get
()
];
}
tests/src/components/contacts/ContactsListModel.hpp
View file @
e6c45503
...
...
@@ -23,10 +23,11 @@ public:
QVariant
data
(
const
QModelIndex
&
index
,
int
role
)
const
;
public
slots
:
static
ContactModel
*
mapSipAddressToContact
(
const
QString
&
sipAddress
);
ContactModel
*
mapSipAddressToContact
(
const
QString
&
sipAddress
);
private:
QList
<
ContactModel
*>
m_list
;
QHash
<
linphone
::
Friend
*
,
ContactModel
*
>
m_friend_to_contact
;
};
#endif // CONTACTS_LIST_MODEL_H
tests/src/components/contacts/ContactsListProxyModel.cpp
View file @
e6c45503
...
...
@@ -122,7 +122,7 @@ float ContactsListProxyModel::computeContactWeight (const ContactModel &contact)
const
list
<
shared_ptr
<
linphone
::
Address
>
>
addresses
=
contact
.
m_linphone_friend
->
getAddresses
();
auto
&&
it
=
addresses
.
cbegin
();
auto
it
=
addresses
.
cbegin
();
// It exists at least one sip address.
weight
+=
computeStringWeight
(
...
...
tests/src/components/timeline/TimelineModel.cpp
View file @
e6c45503
...
...
@@ -29,7 +29,7 @@ TimelineModel::TimelineModel (QObject *parent): QAbstractListModel(parent) {
shared_ptr
<
linphone
::
Core
>
core
(
CoreManager
::
getInstance
()
->
getCore
());
// Insert chat rooms events.
for
(
auto
&&
chat_room
:
core
->
getChatRooms
())
{
for
(
const
auto
&
chat_room
:
core
->
getChatRooms
())
{
list
<
shared_ptr
<
linphone
::
ChatMessage
>
>
history
=
chat_room
->
getHistory
(
0
);
if
(
history
.
size
()
==
0
)
...
...
@@ -50,7 +50,7 @@ TimelineModel::TimelineModel (QObject *parent): QAbstractListModel(parent) {
// Insert calls events.
QHash
<
QString
,
bool
>
address_done
;
for
(
auto
&&
call_log
:
core
->
getCallLogs
())
{
for
(
const
auto
&
call_log
:
core
->
getCallLogs
())
{
// Get a sip uri to check.
QString
address
=
Utils
::
linphoneStringToQString
(
call_log
->
getRemoteAddress
()
->
asString
()
...
...
@@ -69,7 +69,7 @@ TimelineModel::TimelineModel (QObject *parent): QAbstractListModel(parent) {
map
[
"sipAddresses"
]
=
address
;
// Search existing entry.
auto
&&
it
=
find_if
(
auto
it
=
find_if
(
m_entries
.
begin
(),
m_entries
.
end
(),
[
&
address
](
const
QVariantMap
&
map
)
{
return
address
==
map
[
"sipAddresses"
].
toString
();
}
...
...
tests/ui/modules/Linphone/Timeline.qml
View file @
e6c45503
...
...
@@ -64,7 +64,7 @@ ColumnLayout {
delegate
:
Item
{
property
var
contact
:
ContactsListModel
.
mapSipAddressToContact
(
$timelineEntry
$timelineEntry
.
sipAddresses
)
height
:
TimelineStyle
.
contact
.
height
...
...
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