From 2ba712cc6808c510c110dcfacfd15c8fa6324619 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 6 Jan 2017 10:40:05 +0100 Subject: [PATCH] fix(app): replace all `asString` calls by `asStringUriOnly` calls --- tests/src/components/chat/ChatModel.cpp | 2 +- tests/src/components/contacts/ContactsListProxyModel.cpp | 2 +- tests/src/components/sip-addresses/SipAddressesModel.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/src/components/chat/ChatModel.cpp b/tests/src/components/chat/ChatModel.cpp index 9ec55a843..007cb0c57 100644 --- a/tests/src/components/chat/ChatModel.cpp +++ b/tests/src/components/chat/ChatModel.cpp @@ -134,7 +134,7 @@ QString ChatModel::getSipAddress () const { return ""; return ::Utils::linphoneStringToQString( - m_chat_room->getPeerAddress()->asString() + m_chat_room->getPeerAddress()->asStringUriOnly() ); } diff --git a/tests/src/components/contacts/ContactsListProxyModel.cpp b/tests/src/components/contacts/ContactsListProxyModel.cpp index 99a6c5fee..0e42679a2 100644 --- a/tests/src/components/contacts/ContactsListProxyModel.cpp +++ b/tests/src/components/contacts/ContactsListProxyModel.cpp @@ -110,7 +110,7 @@ float ContactsListProxyModel::computeContactWeight (const ContactModel &contact) float size = static_cast(addresses.size()); for (auto it = addresses.cbegin(); it != addresses.cend(); ++it) weight += computeStringWeight( - ::Utils::linphoneStringToQString((*it)->asString()), + ::Utils::linphoneStringToQString((*it)->asStringUriOnly()), SIP_ADDRESSES_WEIGHT / size ); diff --git a/tests/src/components/sip-addresses/SipAddressesModel.cpp b/tests/src/components/sip-addresses/SipAddressesModel.cpp index ef95aa724..9bda676ef 100644 --- a/tests/src/components/sip-addresses/SipAddressesModel.cpp +++ b/tests/src/components/sip-addresses/SipAddressesModel.cpp @@ -173,7 +173,7 @@ void SipAddressesModel::handleReceivedMessage ( const shared_ptr &, const shared_ptr &message ) { - const QString &sip_address = ::Utils::linphoneStringToQString(message->getFromAddress()->asString()); + const QString &sip_address = ::Utils::linphoneStringToQString(message->getFromAddress()->asStringUriOnly()); addOrUpdateSipAddress(sip_address, nullptr, static_cast(message->getTime())); } @@ -253,7 +253,7 @@ void SipAddressesModel::initSipAddresses () { if (history.size() == 0) continue; - QString sip_address = ::Utils::linphoneStringToQString(chat_room->getPeerAddress()->asString()); + QString sip_address = ::Utils::linphoneStringToQString(chat_room->getPeerAddress()->asStringUriOnly()); QVariantMap map; map["sipAddress"] = sip_address; @@ -265,7 +265,7 @@ void SipAddressesModel::initSipAddresses () { // Get sip addresses from calls. QSet address_done; for (const auto &call_log : core->getCallLogs()) { - QString sip_address = ::Utils::linphoneStringToQString(call_log->getRemoteAddress()->asStringUriOnly()); + const QString &sip_address = ::Utils::linphoneStringToQString(call_log->getRemoteAddress()->asStringUriOnly()); if (address_done.contains(sip_address)) continue; // Already used.