Commit d3a54121 authored by Ghislain MARY's avatar Ghislain MARY

Fix build.

parent 2ac32404
...@@ -337,7 +337,7 @@ void CallModel::setPausedByUser (bool status) { ...@@ -337,7 +337,7 @@ void CallModel::setPausedByUser (bool status) {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
bool CallModel::getVideoEnabled () const { bool CallModel::getVideoEnabled () const {
shared_ptr<linphone::CallParams> params = m_linphone_call->getCurrentParams(); shared_ptr<const linphone::CallParams> params = m_linphone_call->getCurrentParams();
return params && params->videoEnabled() && getStatus() == CallStatusConnected; return params && params->videoEnabled() && getStatus() == CallStatusConnected;
} }
......
...@@ -117,7 +117,7 @@ private: ...@@ -117,7 +117,7 @@ private:
shared_ptr<linphone::Buffer> onFileTransferSend ( shared_ptr<linphone::Buffer> onFileTransferSend (
const shared_ptr<linphone::ChatMessage> &, const shared_ptr<linphone::ChatMessage> &,
const shared_ptr<linphone::Content> &, const shared_ptr<const linphone::Content> &,
size_t, size_t,
size_t size_t
) override { ) override {
...@@ -127,7 +127,7 @@ private: ...@@ -127,7 +127,7 @@ private:
void onFileTransferProgressIndication ( void onFileTransferProgressIndication (
const shared_ptr<linphone::ChatMessage> &message, const shared_ptr<linphone::ChatMessage> &message,
const shared_ptr<linphone::Content> &, const shared_ptr<const linphone::Content> &,
size_t offset, size_t offset,
size_t size_t
) override { ) override {
...@@ -456,7 +456,7 @@ void ChatModel::fillMessageEntry (QVariantMap &dest, const shared_ptr<linphone:: ...@@ -456,7 +456,7 @@ void ChatModel::fillMessageEntry (QVariantMap &dest, const shared_ptr<linphone::
dest["isOutgoing"] = message->isOutgoing() || message->getState() == linphone::ChatMessageStateIdle; dest["isOutgoing"] = message->isOutgoing() || message->getState() == linphone::ChatMessageStateIdle;
dest["status"] = message->getState(); dest["status"] = message->getState();
shared_ptr<linphone::Content> content = message->getFileTransferInformation(); shared_ptr<const linphone::Content> content = message->getFileTransferInformation();
if (content) { if (content) {
dest["fileSize"] = static_cast<quint64>(content->getSize()); dest["fileSize"] = static_cast<quint64>(content->getSize());
dest["fileName"] = ::Utils::linphoneStringToQString(content->getName()); dest["fileName"] = ::Utils::linphoneStringToQString(content->getName());
......
...@@ -71,7 +71,7 @@ void CoreHandlers::onNotifyPresenceReceivedForUriOrTel ( ...@@ -71,7 +71,7 @@ void CoreHandlers::onNotifyPresenceReceivedForUriOrTel (
const shared_ptr<linphone::Core> &, const shared_ptr<linphone::Core> &,
const shared_ptr<linphone::Friend> &linphone_friend, const shared_ptr<linphone::Friend> &linphone_friend,
const string &, const string &,
const shared_ptr<linphone::PresenceModel> & const shared_ptr<const linphone::PresenceModel> &
) { ) {
linphone_friend->getData<ContactModel>("contact-model").refreshPresence(); linphone_friend->getData<ContactModel>("contact-model").refreshPresence();
} }
......
...@@ -61,7 +61,7 @@ private: ...@@ -61,7 +61,7 @@ private:
const std::shared_ptr<linphone::Core> &core, const std::shared_ptr<linphone::Core> &core,
const std::shared_ptr<linphone::Friend> &linphone_friend, const std::shared_ptr<linphone::Friend> &linphone_friend,
const std::string &uri_or_tel, const std::string &uri_or_tel,
const std::shared_ptr<linphone::PresenceModel> &presence_model const std::shared_ptr<const linphone::PresenceModel> &presence_model
) override; ) override;
void onRegistrationStateChanged ( void onRegistrationStateChanged (
......
...@@ -37,7 +37,7 @@ void AccountSettingsModel::setDefaultProxyConfig (const shared_ptr<linphone::Pro ...@@ -37,7 +37,7 @@ void AccountSettingsModel::setDefaultProxyConfig (const shared_ptr<linphone::Pro
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString AccountSettingsModel::getUsername () const { QString AccountSettingsModel::getUsername () const {
shared_ptr<linphone::Address> address = getUsedSipAddress(); shared_ptr<const linphone::Address> address = getUsedSipAddress();
const string &display_name = address->getDisplayName(); const string &display_name = address->getDisplayName();
return ::Utils::linphoneStringToQString( return ::Utils::linphoneStringToQString(
...@@ -46,11 +46,15 @@ QString AccountSettingsModel::getUsername () const { ...@@ -46,11 +46,15 @@ QString AccountSettingsModel::getUsername () const {
} }
void AccountSettingsModel::setUsername (const QString &username) { void AccountSettingsModel::setUsername (const QString &username) {
shared_ptr<linphone::Address> address = getUsedSipAddress(); shared_ptr<const linphone::Address> address = getUsedSipAddress();
shared_ptr<linphone::Address> new_address = address->clone();
if (address->setDisplayName(::Utils::qStringToLinphoneString(username))) if (new_address->setDisplayName(::Utils::qStringToLinphoneString(username))) {
qWarning() << QStringLiteral("Unable to set displayName on sip address: `%1`.") qWarning() << QStringLiteral("Unable to set displayName on sip address: `%1`.")
.arg(::Utils::linphoneStringToQString(address->asStringUriOnly())); .arg(::Utils::linphoneStringToQString(new_address->asStringUriOnly()));
} else {
setUsedSipAddress(new_address);
}
emit accountSettingsUpdated(); emit accountSettingsUpdated();
} }
...@@ -126,7 +130,14 @@ QVariantList AccountSettingsModel::getAccounts () const { ...@@ -126,7 +130,14 @@ QVariantList AccountSettingsModel::getAccounts () const {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
shared_ptr<linphone::Address> AccountSettingsModel::getUsedSipAddress () const { void AccountSettingsModel::setUsedSipAddress (const std::shared_ptr<const linphone::Address> &address) {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
shared_ptr<linphone::ProxyConfig> proxy_config = core->getDefaultProxyConfig();
proxy_config ? proxy_config->setIdentityAddress(address) : core->setPrimaryContact(address->asString());
}
shared_ptr<const linphone::Address> AccountSettingsModel::getUsedSipAddress () const {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore(); shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
shared_ptr<linphone::ProxyConfig> proxy_config = core->getDefaultProxyConfig(); shared_ptr<linphone::ProxyConfig> proxy_config = core->getDefaultProxyConfig();
......
...@@ -64,7 +64,8 @@ private: ...@@ -64,7 +64,8 @@ private:
QVariantList getAccounts () const; QVariantList getAccounts () const;
std::shared_ptr<linphone::Address> getUsedSipAddress () const; void setUsedSipAddress (const std::shared_ptr<const linphone::Address> &address);
std::shared_ptr<const linphone::Address> getUsedSipAddress () const;
}; };
Q_DECLARE_METATYPE(std::shared_ptr<linphone::ProxyConfig> ); Q_DECLARE_METATYPE(std::shared_ptr<linphone::ProxyConfig> );
......
...@@ -510,7 +510,7 @@ void SettingsModel::setTurnUser (const QString &user) { ...@@ -510,7 +510,7 @@ void SettingsModel::setTurnUser (const QString &user) {
QString SettingsModel::getTurnPassword () const { QString SettingsModel::getTurnPassword () const {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore(); shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
shared_ptr<linphone::NatPolicy> nat_policy = core->getNatPolicy(); shared_ptr<linphone::NatPolicy> nat_policy = core->getNatPolicy();
shared_ptr<linphone::AuthInfo> auth_info = core->findAuthInfo(nat_policy->getStunServerUsername(), "", ""); shared_ptr<const linphone::AuthInfo> auth_info = core->findAuthInfo(nat_policy->getStunServerUsername(), "", "");
return auth_info ? ::Utils::linphoneStringToQString(auth_info->getPasswd()) : ""; return auth_info ? ::Utils::linphoneStringToQString(auth_info->getPasswd()) : "";
} }
...@@ -520,7 +520,7 @@ void SettingsModel::setTurnPassword (const QString &password) { ...@@ -520,7 +520,7 @@ void SettingsModel::setTurnPassword (const QString &password) {
shared_ptr<linphone::NatPolicy> nat_policy = core->getNatPolicy(); shared_ptr<linphone::NatPolicy> nat_policy = core->getNatPolicy();
const string &username = nat_policy->getStunServerUsername(); const string &username = nat_policy->getStunServerUsername();
shared_ptr<linphone::AuthInfo> auth_info = core->findAuthInfo(username, "", ""); shared_ptr<const linphone::AuthInfo> auth_info = core->findAuthInfo(username, "", "");
if (auth_info) { if (auth_info) {
shared_ptr<linphone::AuthInfo> auth_info_clone = auth_info->clone(); shared_ptr<linphone::AuthInfo> auth_info_clone = auth_info->clone();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment