diff --git a/submodules/linphone b/submodules/linphone index 15f2e55be..703dc8822 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 15f2e55bee0a50647fc4cbf66ec9a3d04b232e44 +Subproject commit 703dc88223b3bb31d0ba13e3c084a39b20317cfe diff --git a/tests/src/app/Database.cpp b/tests/src/app/Database.cpp index faa0ca9a5..cf1620738 100644 --- a/tests/src/app/Database.cpp +++ b/tests/src/app/Database.cpp @@ -2,6 +2,8 @@ #include #include +#include "../utils.hpp" + #include "Database.hpp" #ifdef _WIN32 @@ -35,7 +37,7 @@ inline string getDatabaseFilePath (const QString &filename) { QString path(DATABASES_PATH + "/"); path += filename; return ensureDatabaseFilePathExists(path) - ? QDir::toNativeSeparators(path).toStdString() + ? Utils::qStringToLinphoneString(QDir::toNativeSeparators(path)) : ""; } diff --git a/tests/src/components/chat/ChatModel.cpp b/tests/src/components/chat/ChatModel.cpp index e86a0ff5c..c8954fedc 100644 --- a/tests/src/components/chat/ChatModel.cpp +++ b/tests/src/components/chat/ChatModel.cpp @@ -1,4 +1,5 @@ #include "../../utils.hpp" +#include "../core/CoreManager.hpp" #include "ChatModel.hpp" @@ -34,5 +35,13 @@ QString ChatModel::getSipAddress () const { } void ChatModel::setSipAddress (const QString &sip_address) { + if (sip_address == getSipAddress()) + return; + + std::shared_ptr chat_room = + CoreManager::getInstance()->getCore()->getChatRoomFromUri( + Utils::qStringToLinphoneString(sip_address) + ); + emit sipAddressChanged(sip_address); } diff --git a/tests/src/components/contacts/ContactsListModel.cpp b/tests/src/components/contacts/ContactsListModel.cpp index 61a8068dc..1153509bf 100644 --- a/tests/src/components/contacts/ContactsListModel.cpp +++ b/tests/src/components/contacts/ContactsListModel.cpp @@ -1,6 +1,7 @@ #include #include "../../app/App.hpp" +#include "../../utils.hpp" #include "../core/CoreManager.hpp" #include "ContactModel.hpp" #include "ContactsListProxyModel.hpp" @@ -77,7 +78,7 @@ ContactModel *ContactsListModel::mapSipAddressToContact (const QString &sipAddre // Maybe use a hashtable in future version to get a lower cost? ContactModel *contact = m_friend_to_contact.value( m_linphone_friends->findFriendByUri( - sipAddress.toStdString() + Utils::qStringToLinphoneString(sipAddress) ).get() ); diff --git a/tests/src/utils.hpp b/tests/src/utils.hpp index 81fce800d..db22ff0c6 100644 --- a/tests/src/utils.hpp +++ b/tests/src/utils.hpp @@ -7,6 +7,10 @@ namespace Utils { inline QString linphoneStringToQString (const std::string &string) { return QString::fromLocal8Bit(string.c_str(), string.size()); } + + inline std::string qStringToLinphoneString (const QString &string) { + return string.toStdString(); + } } #endif // UTILS_H_