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
9cb733a2
Commit
9cb733a2
authored
Nov 18, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unstable
parent
558a55de
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
33 additions
and
25 deletions
+33
-25
CMakeLists.txt
tests/CMakeLists.txt
+3
-0
Database.hpp
tests/src/app/Database.hpp
+2
-0
ContactModel.cpp
tests/src/components/contacts/ContactModel.cpp
+0
-8
ContactModel.hpp
tests/src/components/contacts/ContactModel.hpp
+11
-8
ContactsListModel.cpp
tests/src/components/contacts/ContactsListModel.cpp
+1
-0
ContactsListProxyModel.cpp
tests/src/components/contacts/ContactsListProxyModel.cpp
+14
-7
Contact.qml
tests/ui/modules/Linphone/Contact/Contact.qml
+1
-1
Conversation.qml
tests/ui/views/App/MainWindow/Conversation.qml
+1
-1
No files found.
tests/CMakeLists.txt
View file @
9cb733a2
...
@@ -58,6 +58,7 @@ set(HEADERS
...
@@ -58,6 +58,7 @@ set(HEADERS
src/components/settings/AccountSettingsModel.hpp
src/components/settings/AccountSettingsModel.hpp
src/components/settings/SettingsModel.hpp
src/components/settings/SettingsModel.hpp
src/components/timeline/TimelineModel.hpp
src/components/timeline/TimelineModel.hpp
src/utils.hpp
)
)
set
(
QRC_RESOURCES
set
(
QRC_RESOURCES
...
@@ -136,5 +137,7 @@ qt5_add_resources(RESOURCES ${QRC_RESOURCES})
...
@@ -136,5 +137,7 @@ qt5_add_resources(RESOURCES ${QRC_RESOURCES})
add_executable
(
${
LINPHONE_EXEC
}
${
SOURCES
}
${
HEADERS
}
${
RESOURCES
}
)
add_executable
(
${
LINPHONE_EXEC
}
${
SOURCES
}
${
HEADERS
}
${
RESOURCES
}
)
add_dependencies
(
${
LINPHONE_EXEC
}
update_translations
)
add_dependencies
(
${
LINPHONE_EXEC
}
update_translations
)
add_dependencies
(
update_translations check_qml
)
add_dependencies
(
update_translations check_qml
)
target_include_directories
(
${
LINPHONE_EXEC
}
PRIVATE
"
${
CMAKE_SOURCE_DIR
}
/../OUTPUT/desktop/include/"
)
target_include_directories
(
${
LINPHONE_EXEC
}
PRIVATE
"
${
CMAKE_SOURCE_DIR
}
/../OUTPUT/desktop/include/"
)
target_link_libraries
(
${
LINPHONE_EXEC
}
${
LIBS
}
)
target_link_libraries
(
${
LINPHONE_EXEC
}
${
LIBS
}
)
tests/src/app/Database.hpp
View file @
9cb733a2
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
#include <string>
#include <string>
// ===================================================================
namespace
Database
{
namespace
Database
{
// Returns the databases paths.
// Returns the databases paths.
// If files cannot be created or are unavailable, a empty string is returned.
// If files cannot be created or are unavailable, a empty string is returned.
...
...
tests/src/components/contacts/ContactModel.cpp
View file @
9cb733a2
...
@@ -25,11 +25,3 @@ Presence::PresenceStatus ContactModel::getPresenceStatus () const {
...
@@ -25,11 +25,3 @@ Presence::PresenceStatus ContactModel::getPresenceStatus () const {
Presence
::
PresenceLevel
ContactModel
::
getPresenceLevel
()
const
{
Presence
::
PresenceLevel
ContactModel
::
getPresenceLevel
()
const
{
return
Presence
::
getPresenceLevel
(
m_presence_status
);
return
Presence
::
getPresenceLevel
(
m_presence_status
);
}
}
QStringList
ContactModel
::
getSipAddresses
()
const
{
return
m_sip_addresses
;
}
void
ContactModel
::
setSipAddresses
(
const
QStringList
&
sip_addresses
)
{
m_sip_addresses
=
sip_addresses
;
}
tests/src/components/contacts/ContactModel.hpp
View file @
9cb733a2
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
#define CONTACT_MODEL_H
#define CONTACT_MODEL_H
#include <QObject>
#include <QObject>
#include <linphone++/linphone.hh>
#include <linphone++/linphone.hh>
#include "../../utils.hpp"
#include "../presence/Presence.hpp"
#include "../presence/Presence.hpp"
// ===================================================================
// ===================================================================
...
@@ -41,16 +41,14 @@ class ContactModel : public QObject {
...
@@ -41,16 +41,14 @@ class ContactModel : public QObject {
);
);
Q_PROPERTY
(
Q_PROPERTY
(
QStringList
sipAddresses
QString
sipAddress
READ
getSipAddresses
READ
getSipAddress
WRITE
setSipAddresses
NOTIFY
contactUpdated
NOTIFY
contactUpdated
);
);
public:
public:
ContactModel
(
std
::
shared_ptr
<
linphone
::
Friend
>
linphone_friend
)
{
ContactModel
(
std
::
shared_ptr
<
linphone
::
Friend
>
linphone_friend
)
{
m_linphone_friend
=
linphone_friend
;
m_linphone_friend
=
linphone_friend
;
m_sip_addresses
<<
"jiiji"
;
}
}
signals:
signals:
...
@@ -66,13 +64,18 @@ private:
...
@@ -66,13 +64,18 @@ private:
Presence
::
PresenceStatus
getPresenceStatus
()
const
;
Presence
::
PresenceStatus
getPresenceStatus
()
const
;
Presence
::
PresenceLevel
getPresenceLevel
()
const
;
Presence
::
PresenceLevel
getPresenceLevel
()
const
;
QStringList
getSipAddresses
()
const
;
QString
getSipAddress
()
const
{
void
setSipAddresses
(
const
QStringList
&
sip_addresses
);
// FIXME.
return
"toto@linphone.org"
;
return
Utils
::
linphoneStringToQString
(
m_linphone_friend
->
getAddress
()
->
asString
()
);
}
QString
m_username
;
QString
m_username
;
QString
m_avatar
;
QString
m_avatar
;
Presence
::
PresenceStatus
m_presence_status
=
Presence
::
Offline
;
Presence
::
PresenceStatus
m_presence_status
=
Presence
::
Offline
;
QStringList
m_sip_addresses
;
std
::
shared_ptr
<
linphone
::
Friend
>
m_linphone_friend
;
std
::
shared_ptr
<
linphone
::
Friend
>
m_linphone_friend
;
};
};
...
...
tests/src/components/contacts/ContactsListModel.cpp
View file @
9cb733a2
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
ContactsListModel
::
ContactsListModel
(
QObject
*
parent
)
:
QAbstractListModel
(
parent
)
{
ContactsListModel
::
ContactsListModel
(
QObject
*
parent
)
:
QAbstractListModel
(
parent
)
{
std
::
shared_ptr
<
linphone
::
Core
>
core
(
CoreManager
::
getInstance
()
->
getCore
());
std
::
shared_ptr
<
linphone
::
Core
>
core
(
CoreManager
::
getInstance
()
->
getCore
());
// Init contacts with linphone friends list.
for
(
auto
friend_
:
core
->
getFriendsLists
().
front
()
->
getFriends
())
{
for
(
auto
friend_
:
core
->
getFriendsLists
().
front
()
->
getFriends
())
{
m_list
<<
new
ContactModel
(
friend_
);
m_list
<<
new
ContactModel
(
friend_
);
}
}
...
...
tests/src/components/contacts/ContactsListProxyModel.cpp
View file @
9cb733a2
...
@@ -51,9 +51,7 @@ bool ContactsListProxyModel::filterAcceptsRow (int source_row, const QModelIndex
...
@@ -51,9 +51,7 @@ bool ContactsListProxyModel::filterAcceptsRow (int source_row, const QModelIndex
index
.
data
()
index
.
data
()
);
);
int
weight
=
m_weights
[
contact
]
=
static_cast
<
int
>
(
int
weight
=
m_weights
[
contact
]
=
computeContactWeight
(
*
contact
);
computeContactWeight
(
*
contact
)
);
return
weight
>
0
&&
(
return
weight
>
0
&&
(
!
m_use_connected_filter
||
!
m_use_connected_filter
||
...
@@ -117,14 +115,23 @@ float ContactsListProxyModel::computeContactWeight (const ContactModel &contact)
...
@@ -117,14 +115,23 @@ float ContactsListProxyModel::computeContactWeight (const ContactModel &contact)
float
weight
=
computeStringWeight
(
contact
.
m_username
,
USERNAME_WEIGHT
);
float
weight
=
computeStringWeight
(
contact
.
m_username
,
USERNAME_WEIGHT
);
// It exists at least one sip address.
// It exists at least one sip address.
const
QStringList
&
addresses
=
contact
.
m_sip_addresses
;
const
std
::
list
<
std
::
shared_ptr
<
linphone
::
Address
>
>
addresses
=
weight
+=
computeStringWeight
(
addresses
[
0
],
MAIN_SIP_ADDRESS_WEIGHT
);
contact
.
m_linphone_friend
->
getAddresses
();
// FIXME.
return
0
;
weight
+=
computeStringWeight
(
contact
.
getSipAddress
(),
MAIN_SIP_ADDRESS_WEIGHT
);
// Compute for other addresses.
int
size
=
addresses
.
size
();
int
size
=
addresses
.
size
();
return
0
;
if
(
size
>
1
)
if
(
size
>
1
)
for
(
auto
it
=
++
addresses
.
constBegin
();
it
!=
addresses
.
constEnd
();
++
it
)
for
(
auto
it
=
++
addresses
.
cbegin
();
it
!=
addresses
.
cend
();
++
it
)
weight
+=
computeStringWeight
(
*
it
,
OTHER_SIP_ADDRESSES_WEIGHT
/
size
);
weight
+=
computeStringWeight
(
Utils
::
linphoneStringToQString
((
*
it
)
->
asString
()),
OTHER_SIP_ADDRESSES_WEIGHT
/
size
);
return
weight
;
return
weight
;
}
}
...
...
tests/ui/modules/Linphone/Contact/Contact.qml
View file @
9cb733a2
...
@@ -40,7 +40,7 @@ Rectangle {
...
@@ -40,7 +40,7 @@ Rectangle {
Layout.fillHeight
:
true
Layout.fillHeight
:
true
Layout.fillWidth
:
true
Layout.fillWidth
:
true
sipAddress
:
contact
.
sipAddress
es
[
0
]
sipAddress
:
contact
.
sipAddress
username
:
avatar
.
username
username
:
avatar
.
username
}
}
...
...
tests/ui/views/App/MainWindow/Conversation.qml
View file @
9cb733a2
...
@@ -40,7 +40,7 @@ ColumnLayout {
...
@@ -40,7 +40,7 @@ ColumnLayout {
ContactDescription
{
ContactDescription
{
Layout.fillHeight
:
true
Layout.fillHeight
:
true
Layout.fillWidth
:
true
Layout.fillWidth
:
true
sipAddress
:
contact
.
sipAddress
es
[
0
]
sipAddress
:
contact
.
sipAddress
sipAddressColor
:
ConversationStyle
.
bar
.
description
.
sipAddressColor
sipAddressColor
:
ConversationStyle
.
bar
.
description
.
sipAddressColor
username
:
contact
.
username
username
:
contact
.
username
usernameColor
:
ConversationStyle
.
bar
.
description
.
usernameColor
usernameColor
:
ConversationStyle
.
bar
.
description
.
usernameColor
...
...
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