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
1459d293
Commit
1459d293
authored
Nov 24, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(utils): add and use a `qStringToLinphoneString` function
parent
31f57b7c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
3 deletions
+19
-3
linphone
submodules/linphone
+1
-1
Database.cpp
tests/src/app/Database.cpp
+3
-1
ChatModel.cpp
tests/src/components/chat/ChatModel.cpp
+9
-0
ContactsListModel.cpp
tests/src/components/contacts/ContactsListModel.cpp
+2
-1
utils.hpp
tests/src/utils.hpp
+4
-0
No files found.
linphone
@
703dc882
Subproject commit
15f2e55bee0a50647fc4cbf66ec9a3d04b232e44
Subproject commit
703dc88223b3bb31d0ba13e3c084a39b20317cfe
tests/src/app/Database.cpp
View file @
1459d293
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
#include <QFile>
#include <QFile>
#include <QStandardPaths>
#include <QStandardPaths>
#include "../utils.hpp"
#include "Database.hpp"
#include "Database.hpp"
#ifdef _WIN32
#ifdef _WIN32
...
@@ -35,7 +37,7 @@ inline string getDatabaseFilePath (const QString &filename) {
...
@@ -35,7 +37,7 @@ inline string getDatabaseFilePath (const QString &filename) {
QString
path
(
DATABASES_PATH
+
"/"
);
QString
path
(
DATABASES_PATH
+
"/"
);
path
+=
filename
;
path
+=
filename
;
return
ensureDatabaseFilePathExists
(
path
)
return
ensureDatabaseFilePathExists
(
path
)
?
QDir
::
toNativeSeparators
(
path
).
toStdString
(
)
?
Utils
::
qStringToLinphoneString
(
QDir
::
toNativeSeparators
(
path
)
)
:
""
;
:
""
;
}
}
...
...
tests/src/components/chat/ChatModel.cpp
View file @
1459d293
#include "../../utils.hpp"
#include "../../utils.hpp"
#include "../core/CoreManager.hpp"
#include "ChatModel.hpp"
#include "ChatModel.hpp"
...
@@ -34,5 +35,13 @@ QString ChatModel::getSipAddress () const {
...
@@ -34,5 +35,13 @@ QString ChatModel::getSipAddress () const {
}
}
void
ChatModel
::
setSipAddress
(
const
QString
&
sip_address
)
{
void
ChatModel
::
setSipAddress
(
const
QString
&
sip_address
)
{
if
(
sip_address
==
getSipAddress
())
return
;
std
::
shared_ptr
<
linphone
::
ChatRoom
>
chat_room
=
CoreManager
::
getInstance
()
->
getCore
()
->
getChatRoomFromUri
(
Utils
::
qStringToLinphoneString
(
sip_address
)
);
emit
sipAddressChanged
(
sip_address
);
emit
sipAddressChanged
(
sip_address
);
}
}
tests/src/components/contacts/ContactsListModel.cpp
View file @
1459d293
#include <QtDebug>
#include <QtDebug>
#include "../../app/App.hpp"
#include "../../app/App.hpp"
#include "../../utils.hpp"
#include "../core/CoreManager.hpp"
#include "../core/CoreManager.hpp"
#include "ContactModel.hpp"
#include "ContactModel.hpp"
#include "ContactsListProxyModel.hpp"
#include "ContactsListProxyModel.hpp"
...
@@ -77,7 +78,7 @@ ContactModel *ContactsListModel::mapSipAddressToContact (const QString &sipAddre
...
@@ -77,7 +78,7 @@ ContactModel *ContactsListModel::mapSipAddressToContact (const QString &sipAddre
// Maybe use a hashtable in future version to get a lower cost?
// Maybe use a hashtable in future version to get a lower cost?
ContactModel
*
contact
=
m_friend_to_contact
.
value
(
ContactModel
*
contact
=
m_friend_to_contact
.
value
(
m_linphone_friends
->
findFriendByUri
(
m_linphone_friends
->
findFriendByUri
(
sipAddress
.
toStdString
(
)
Utils
::
qStringToLinphoneString
(
sipAddress
)
).
get
()
).
get
()
);
);
...
...
tests/src/utils.hpp
View file @
1459d293
...
@@ -7,6 +7,10 @@ namespace Utils {
...
@@ -7,6 +7,10 @@ namespace Utils {
inline
QString
linphoneStringToQString
(
const
std
::
string
&
string
)
{
inline
QString
linphoneStringToQString
(
const
std
::
string
&
string
)
{
return
QString
::
fromLocal8Bit
(
string
.
c_str
(),
string
.
size
());
return
QString
::
fromLocal8Bit
(
string
.
c_str
(),
string
.
size
());
}
}
inline
std
::
string
qStringToLinphoneString
(
const
QString
&
string
)
{
return
string
.
toStdString
();
}
}
}
#endif // UTILS_H_
#endif // UTILS_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