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
be46f8cf
Commit
be46f8cf
authored
May 05, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(src/components/contacts/ContactsListModel): remove friend without vcard
parent
8797a2e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
ContactsListModel.cpp
...one-desktop/src/components/contacts/ContactsListModel.cpp
+14
-5
No files found.
linphone-desktop/src/components/contacts/ContactsListModel.cpp
View file @
be46f8cf
...
...
@@ -35,14 +35,23 @@ using namespace std;
ContactsListModel
::
ContactsListModel
(
QObject
*
parent
)
:
QAbstractListModel
(
parent
)
{
mLinphoneFriends
=
CoreManager
::
getInstance
()
->
getCore
()
->
getFriendsLists
().
front
();
// Clean friends.
{
list
<
shared_ptr
<
linphone
::
Friend
>
>
toRemove
;
for
(
const
auto
&
linphoneFriend
:
mLinphoneFriends
->
getFriends
())
{
if
(
!
linphoneFriend
->
getVcard
())
toRemove
.
push_back
(
linphoneFriend
);
}
for
(
const
auto
&
linphoneFriend
:
toRemove
)
{
qWarning
()
<<
QStringLiteral
(
"Remove one linphone friend without vcard."
);
mLinphoneFriends
->
removeFriend
(
linphoneFriend
);
}
}
// Init contacts with linphone friends list.
QQmlEngine
*
engine
=
App
::
getInstance
()
->
getEngine
();
for
(
const
auto
&
linphoneFriend
:
mLinphoneFriends
->
getFriends
())
{
if
(
!
linphoneFriend
->
getVcard
())
{
qWarning
()
<<
QStringLiteral
(
"Ignore one linphone friend without vcard."
);
continue
;
}
ContactModel
*
contact
=
new
ContactModel
(
this
,
linphoneFriend
);
// See: http://doc.qt.io/qt-5/qtqml-cppintegration-data.html#data-ownership
...
...
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