Fix build.

This commit is contained in:
Ghislain MARY 2017-03-27 14:41:58 +02:00
parent 2ac3240426
commit d3a54121e7
7 changed files with 26 additions and 14 deletions

View file

@ -337,7 +337,7 @@ void CallModel::setPausedByUser (bool status) {
// -----------------------------------------------------------------------------
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;
}

View file

@ -117,7 +117,7 @@ private:
shared_ptr<linphone::Buffer> onFileTransferSend (
const shared_ptr<linphone::ChatMessage> &,
const shared_ptr<linphone::Content> &,
const shared_ptr<const linphone::Content> &,
size_t,
size_t
) override {
@ -127,7 +127,7 @@ private:
void onFileTransferProgressIndication (
const shared_ptr<linphone::ChatMessage> &message,
const shared_ptr<linphone::Content> &,
const shared_ptr<const linphone::Content> &,
size_t offset,
size_t
) override {
@ -456,7 +456,7 @@ void ChatModel::fillMessageEntry (QVariantMap &dest, const shared_ptr<linphone::
dest["isOutgoing"] = message->isOutgoing() || message->getState() == linphone::ChatMessageStateIdle;
dest["status"] = message->getState();
shared_ptr<linphone::Content> content = message->getFileTransferInformation();
shared_ptr<const linphone::Content> content = message->getFileTransferInformation();
if (content) {
dest["fileSize"] = static_cast<quint64>(content->getSize());
dest["fileName"] = ::Utils::linphoneStringToQString(content->getName());

View file

@ -71,7 +71,7 @@ void CoreHandlers::onNotifyPresenceReceivedForUriOrTel (
const shared_ptr<linphone::Core> &,
const shared_ptr<linphone::Friend> &linphone_friend,
const string &,
const shared_ptr<linphone::PresenceModel> &
const shared_ptr<const linphone::PresenceModel> &
) {
linphone_friend->getData<ContactModel>("contact-model").refreshPresence();
}

View file

@ -61,7 +61,7 @@ private:
const std::shared_ptr<linphone::Core> &core,
const std::shared_ptr<linphone::Friend> &linphone_friend,
const std::string &uri_or_tel,
const std::shared_ptr<linphone::PresenceModel> &presence_model
const std::shared_ptr<const linphone::PresenceModel> &presence_model
) override;
void onRegistrationStateChanged (

View file

@ -37,7 +37,7 @@ void AccountSettingsModel::setDefaultProxyConfig (const shared_ptr<linphone::Pro
// -----------------------------------------------------------------------------
QString AccountSettingsModel::getUsername () const {
shared_ptr<linphone::Address> address = getUsedSipAddress();
shared_ptr<const linphone::Address> address = getUsedSipAddress();
const string &display_name = address->getDisplayName();
return ::Utils::linphoneStringToQString(
@ -46,11 +46,15 @@ QString AccountSettingsModel::getUsername () const {
}
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`.")
.arg(::Utils::linphoneStringToQString(address->asStringUriOnly()));
.arg(::Utils::linphoneStringToQString(new_address->asStringUriOnly()));
} else {
setUsedSipAddress(new_address);
}
emit accountSettingsUpdated();
}
@ -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::ProxyConfig> proxy_config = core->getDefaultProxyConfig();

View file

@ -64,7 +64,8 @@ private:
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> );

View file

@ -510,7 +510,7 @@ void SettingsModel::setTurnUser (const QString &user) {
QString SettingsModel::getTurnPassword () const {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
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()) : "";
}
@ -520,7 +520,7 @@ void SettingsModel::setTurnPassword (const QString &password) {
shared_ptr<linphone::NatPolicy> nat_policy = core->getNatPolicy();
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) {
shared_ptr<linphone::AuthInfo> auth_info_clone = auth_info->clone();