Commit 0eaa2521 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(app): replace `linphoneStringToQString` to `coreStringToAppString`

parent 84110f16
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
// ============================================================================= // =============================================================================
namespace Utils { namespace Utils {
inline QString linphoneStringToQString (const std::string &string) { inline QString coreStringToAppString (const std::string &string) {
return QString::fromLocal8Bit(string.c_str(), static_cast<int>(string.size())); return QString::fromLocal8Bit(string.c_str(), static_cast<int>(string.size()));
} }
......
...@@ -435,7 +435,7 @@ void App::createNotifier () { ...@@ -435,7 +435,7 @@ void App::createNotifier () {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString App::getConfigLocale () const { QString App::getConfigLocale () const {
return ::Utils::linphoneStringToQString( return ::Utils::coreStringToAppString(
CoreManager::getInstance()->getCore()->getConfig()->getString( CoreManager::getInstance()->getCore()->getConfig()->getString(
SettingsModel::UI_SECTION, "locale", "" SettingsModel::UI_SECTION, "locale", ""
) )
......
...@@ -154,7 +154,7 @@ inline QString getAppMessageHistoryFilePath () { ...@@ -154,7 +154,7 @@ inline QString getAppMessageHistoryFilePath () {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
bool Paths::filePathExists (const string &path) { bool Paths::filePathExists (const string &path) {
return filePathExists(Utils::linphoneStringToQString(path)); return filePathExists(Utils::coreStringToAppString(path));
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
......
...@@ -33,7 +33,7 @@ AvatarProvider::AvatarProvider () : QQuickImageProvider( ...@@ -33,7 +33,7 @@ AvatarProvider::AvatarProvider () : QQuickImageProvider(
QQmlImageProviderBase::Image, QQmlImageProviderBase::Image,
QQmlImageProviderBase::ForceAsynchronousImageLoading QQmlImageProviderBase::ForceAsynchronousImageLoading
) { ) {
mAvatarsPath = Utils::linphoneStringToQString(Paths::getAvatarsDirPath()); mAvatarsPath = Utils::coreStringToAppString(Paths::getAvatarsDirPath());
} }
QImage AvatarProvider::requestImage (const QString &id, QSize *, const QSize &) { QImage AvatarProvider::requestImage (const QString &id, QSize *, const QSize &) {
......
...@@ -33,7 +33,7 @@ ThumbnailProvider::ThumbnailProvider () : QQuickImageProvider( ...@@ -33,7 +33,7 @@ ThumbnailProvider::ThumbnailProvider () : QQuickImageProvider(
QQmlImageProviderBase::Image, QQmlImageProviderBase::Image,
QQmlImageProviderBase::ForceAsynchronousImageLoading QQmlImageProviderBase::ForceAsynchronousImageLoading
) { ) {
mThumbnailsPath = Utils::linphoneStringToQString(Paths::getThumbnailsDirPath()); mThumbnailsPath = Utils::coreStringToAppString(Paths::getThumbnailsDirPath());
} }
QImage ThumbnailProvider::requestImage (const QString &id, QSize *, const QSize &) { QImage ThumbnailProvider::requestImage (const QString &id, QSize *, const QSize &) {
......
...@@ -191,7 +191,7 @@ void AssistantModel::reset () { ...@@ -191,7 +191,7 @@ void AssistantModel::reset () {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString AssistantModel::getEmail () const { QString AssistantModel::getEmail () const {
return ::Utils::linphoneStringToQString(mAccountCreator->getEmail()); return ::Utils::coreStringToAppString(mAccountCreator->getEmail());
} }
void AssistantModel::setEmail (const QString &email) { void AssistantModel::setEmail (const QString &email) {
...@@ -215,7 +215,7 @@ void AssistantModel::setEmail (const QString &email) { ...@@ -215,7 +215,7 @@ void AssistantModel::setEmail (const QString &email) {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString AssistantModel::getPassword () const { QString AssistantModel::getPassword () const {
return ::Utils::linphoneStringToQString(mAccountCreator->getPassword()); return ::Utils::coreStringToAppString(mAccountCreator->getPassword());
} }
void AssistantModel::setPassword (const QString &password) { void AssistantModel::setPassword (const QString &password) {
...@@ -233,11 +233,11 @@ void AssistantModel::setPassword (const QString &password) { ...@@ -233,11 +233,11 @@ void AssistantModel::setPassword (const QString &password) {
break; break;
case linphone::AccountCreatorPasswordStatusInvalidCharacters: case linphone::AccountCreatorPasswordStatusInvalidCharacters:
error = tr("passwordStatusInvalidCharacters") error = tr("passwordStatusInvalidCharacters")
.arg(::Utils::linphoneStringToQString(config->getString("assistant", "password_regex", ""))); .arg(::Utils::coreStringToAppString(config->getString("assistant", "password_regex", "")));
break; break;
case linphone::AccountCreatorPasswordStatusMissingCharacters: case linphone::AccountCreatorPasswordStatusMissingCharacters:
error = tr("passwordStatusMissingCharacters") error = tr("passwordStatusMissingCharacters")
.arg(::Utils::linphoneStringToQString(config->getString("assistant", "missing_characters", ""))); .arg(::Utils::coreStringToAppString(config->getString("assistant", "missing_characters", "")));
break; break;
} }
...@@ -247,7 +247,7 @@ void AssistantModel::setPassword (const QString &password) { ...@@ -247,7 +247,7 @@ void AssistantModel::setPassword (const QString &password) {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString AssistantModel::getPhoneNumber () const { QString AssistantModel::getPhoneNumber () const {
return ::Utils::linphoneStringToQString(mAccountCreator->getPhoneNumber()); return ::Utils::coreStringToAppString(mAccountCreator->getPhoneNumber());
} }
void AssistantModel::setPhoneNumber (const QString &phoneNumber) { void AssistantModel::setPhoneNumber (const QString &phoneNumber) {
...@@ -262,7 +262,7 @@ void AssistantModel::setPhoneNumber (const QString &phoneNumber) { ...@@ -262,7 +262,7 @@ void AssistantModel::setPhoneNumber (const QString &phoneNumber) {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString AssistantModel::getUsername () const { QString AssistantModel::getUsername () const {
return ::Utils::linphoneStringToQString(mAccountCreator->getUsername()); return ::Utils::coreStringToAppString(mAccountCreator->getUsername());
} }
void AssistantModel::setUsername (const QString &username) { void AssistantModel::setUsername (const QString &username) {
...@@ -277,7 +277,7 @@ void AssistantModel::setUsername (const QString &username) { ...@@ -277,7 +277,7 @@ void AssistantModel::setUsername (const QString &username) {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString AssistantModel::getDisplayName () const { QString AssistantModel::getDisplayName () const {
return ::Utils::linphoneStringToQString(mAccountCreator->getDisplayName()); return ::Utils::coreStringToAppString(mAccountCreator->getDisplayName());
} }
void AssistantModel::setDisplayName (const QString &displayName) { void AssistantModel::setDisplayName (const QString &displayName) {
...@@ -298,7 +298,7 @@ QString AssistantModel::getConfigFilename () const { ...@@ -298,7 +298,7 @@ QString AssistantModel::getConfigFilename () const {
void AssistantModel::setConfigFilename (const QString &configFilename) { void AssistantModel::setConfigFilename (const QString &configFilename) {
mConfigFilename = configFilename; mConfigFilename = configFilename;
QString configPath = ::Utils::linphoneStringToQString(Paths::getAssistantConfigDirPath()) + configFilename; QString configPath = ::Utils::coreStringToAppString(Paths::getAssistantConfigDirPath()) + configFilename;
qInfo() << QStringLiteral("Set config on assistant: `%1`.").arg(configPath); qInfo() << QStringLiteral("Set config on assistant: `%1`.").arg(configPath);
CoreManager::getInstance()->getCore()->getConfig()->loadFromXmlFile( CoreManager::getInstance()->getCore()->getConfig()->loadFromXmlFile(
...@@ -325,7 +325,7 @@ QString AssistantModel::mapAccountCreatorUsernameStatusToString (linphone::Accou ...@@ -325,7 +325,7 @@ QString AssistantModel::mapAccountCreatorUsernameStatusToString (linphone::Accou
break; break;
case linphone::AccountCreatorUsernameStatusInvalidCharacters: case linphone::AccountCreatorUsernameStatusInvalidCharacters:
error = tr("usernameStatusInvalidCharacters") error = tr("usernameStatusInvalidCharacters")
.arg(::Utils::linphoneStringToQString(config->getString("assistant", "username_regex", ""))); .arg(::Utils::coreStringToAppString(config->getString("assistant", "username_regex", "")));
break; break;
case linphone::AccountCreatorUsernameStatusInvalid: case linphone::AccountCreatorUsernameStatusInvalid:
error = tr("usernameStatusInvalid"); error = tr("usernameStatusInvalid");
......
...@@ -39,12 +39,12 @@ AuthenticationNotifier::AuthenticationNotifier (QObject *parent) : QObject(paren ...@@ -39,12 +39,12 @@ AuthenticationNotifier::AuthenticationNotifier (QObject *parent) : QObject(paren
void AuthenticationNotifier::handleAuthenticationRequested (const shared_ptr<linphone::AuthInfo> &authInfo) { void AuthenticationNotifier::handleAuthenticationRequested (const shared_ptr<linphone::AuthInfo> &authInfo) {
emit authenticationRequested( emit authenticationRequested(
QVariant::fromValue(authInfo), QVariant::fromValue(authInfo),
::Utils::linphoneStringToQString(authInfo->getRealm()), ::Utils::coreStringToAppString(authInfo->getRealm()),
QStringLiteral("%1@%2").arg( QStringLiteral("%1@%2").arg(
::Utils::linphoneStringToQString(authInfo->getUsername()) ::Utils::coreStringToAppString(authInfo->getUsername())
).arg( ).arg(
::Utils::linphoneStringToQString(authInfo->getDomain()) ::Utils::coreStringToAppString(authInfo->getDomain())
), ),
::Utils::linphoneStringToQString(authInfo->getUserid()) ::Utils::coreStringToAppString(authInfo->getUserid())
); );
} }
...@@ -71,7 +71,7 @@ CallModel::~CallModel () { ...@@ -71,7 +71,7 @@ CallModel::~CallModel () {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString CallModel::getSipAddress () const { QString CallModel::getSipAddress () const {
return ::Utils::linphoneStringToQString(mCall->getRemoteAddress()->asStringUriOnly()); return ::Utils::coreStringToAppString(mCall->getRemoteAddress()->asStringUriOnly());
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
...@@ -541,7 +541,7 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt ...@@ -541,7 +541,7 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt
statsList.clear(); statsList.clear();
statsList << createStat(tr("callStatsCodec"), payloadType statsList << createStat(tr("callStatsCodec"), payloadType
? QString("%1 / %2kHz").arg(Utils::linphoneStringToQString(payloadType->getMimeType())).arg(payloadType->getClockRate() / 1000) ? QString("%1 / %2kHz").arg(Utils::coreStringToAppString(payloadType->getMimeType())).arg(payloadType->getClockRate() / 1000)
: ""); : "");
statsList << createStat(tr("callStatsUploadBandwidth"), QString("%1 kbits/s").arg(int(callStats->getUploadBandwidth()))); statsList << createStat(tr("callStatsUploadBandwidth"), QString("%1 kbits/s").arg(int(callStats->getUploadBandwidth())));
statsList << createStat(tr("callStatsDownloadBandwidth"), QString("%1 kbits/s").arg(int(callStats->getDownloadBandwidth()))); statsList << createStat(tr("callStatsDownloadBandwidth"), QString("%1 kbits/s").arg(int(callStats->getDownloadBandwidth())));
...@@ -555,7 +555,7 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt ...@@ -555,7 +555,7 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt
statsList << createStat(tr("callStatsJitterBuffer"), QString("%1 ms").arg(callStats->getJitterBufferSizeMs())); statsList << createStat(tr("callStatsJitterBuffer"), QString("%1 ms").arg(callStats->getJitterBufferSizeMs()));
break; break;
case linphone::StreamTypeVideo: { case linphone::StreamTypeVideo: {
QString sentVideoDefinitionName = Utils::linphoneStringToQString(params->getSentVideoDefinition()->getName()); QString sentVideoDefinitionName = Utils::coreStringToAppString(params->getSentVideoDefinition()->getName());
QString sentVideoDefinition = QString("%1x%2") QString sentVideoDefinition = QString("%1x%2")
.arg(params->getSentVideoDefinition()->getWidth()) .arg(params->getSentVideoDefinition()->getWidth())
.arg(params->getSentVideoDefinition()->getHeight()); .arg(params->getSentVideoDefinition()->getHeight());
...@@ -564,7 +564,7 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt ...@@ -564,7 +564,7 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt
? sentVideoDefinition ? sentVideoDefinition
: QString("%1 (%2)").arg(sentVideoDefinition).arg(sentVideoDefinitionName)); : QString("%1 (%2)").arg(sentVideoDefinition).arg(sentVideoDefinitionName));
QString receivedVideoDefinitionName = Utils::linphoneStringToQString(params->getReceivedVideoDefinition()->getName()); QString receivedVideoDefinitionName = Utils::coreStringToAppString(params->getReceivedVideoDefinition()->getName());
QString receivedVideoDefinition = QString("%1x%2") QString receivedVideoDefinition = QString("%1x%2")
.arg(params->getReceivedVideoDefinition()->getWidth()) .arg(params->getReceivedVideoDefinition()->getWidth())
.arg(params->getReceivedVideoDefinition()->getHeight()); .arg(params->getReceivedVideoDefinition()->getHeight());
......
...@@ -52,14 +52,14 @@ inline void fillThumbnailProperty (QVariantMap &dest, const shared_ptr<linphone: ...@@ -52,14 +52,14 @@ inline void fillThumbnailProperty (QVariantMap &dest, const shared_ptr<linphone:
string fileId = message->getAppdata(); string fileId = message->getAppdata();
if (!fileId.empty() && !dest.contains("thumbnail")) if (!fileId.empty() && !dest.contains("thumbnail"))
dest["thumbnail"] = QStringLiteral("image://%1/%2") dest["thumbnail"] = QStringLiteral("image://%1/%2")
.arg(ThumbnailProvider::PROVIDER_ID).arg(::Utils::linphoneStringToQString(fileId)); .arg(ThumbnailProvider::PROVIDER_ID).arg(::Utils::coreStringToAppString(fileId));
} }
inline void createThumbnail (const shared_ptr<linphone::ChatMessage> &message) { inline void createThumbnail (const shared_ptr<linphone::ChatMessage> &message) {
if (!message->getAppdata().empty()) if (!message->getAppdata().empty())
return; return;
QString thumbnailPath = ::Utils::linphoneStringToQString(message->getFileTransferFilepath()); QString thumbnailPath = ::Utils::coreStringToAppString(message->getFileTransferFilepath());
QImage image(thumbnailPath); QImage image(thumbnailPath);
if (image.isNull()) if (image.isNull())
...@@ -73,7 +73,7 @@ inline void createThumbnail (const shared_ptr<linphone::ChatMessage> &message) { ...@@ -73,7 +73,7 @@ inline void createThumbnail (const shared_ptr<linphone::ChatMessage> &message) {
QString uuid = QUuid::createUuid().toString(); QString uuid = QUuid::createUuid().toString();
QString fileId = QStringLiteral("%1.jpg").arg(uuid.mid(1, uuid.length() - 2)); QString fileId = QStringLiteral("%1.jpg").arg(uuid.mid(1, uuid.length() - 2));
if (!thumbnail.save(::Utils::linphoneStringToQString(Paths::getThumbnailsDirPath()) + fileId, "jpg", 100)) { if (!thumbnail.save(::Utils::coreStringToAppString(Paths::getThumbnailsDirPath()) + fileId, "jpg", 100)) {
qWarning() << QStringLiteral("Unable to create thumbnail of: `%1`.").arg(thumbnailPath); qWarning() << QStringLiteral("Unable to create thumbnail of: `%1`.").arg(thumbnailPath);
return; return;
} }
...@@ -87,7 +87,7 @@ inline void removeFileMessageThumbnail (const shared_ptr<linphone::ChatMessage> ...@@ -87,7 +87,7 @@ inline void removeFileMessageThumbnail (const shared_ptr<linphone::ChatMessage>
string fileId = message->getAppdata(); string fileId = message->getAppdata();
if (!fileId.empty()) { if (!fileId.empty()) {
QString thumbnailPath = ::Utils::linphoneStringToQString(Paths::getThumbnailsDirPath() + fileId); QString thumbnailPath = ::Utils::coreStringToAppString(Paths::getThumbnailsDirPath() + fileId);
if (!QFile::remove(thumbnailPath)) if (!QFile::remove(thumbnailPath))
qWarning() << QStringLiteral("Unable to remove `%1`.").arg(thumbnailPath); qWarning() << QStringLiteral("Unable to remove `%1`.").arg(thumbnailPath);
} }
...@@ -243,7 +243,7 @@ QString ChatModel::getSipAddress () const { ...@@ -243,7 +243,7 @@ QString ChatModel::getSipAddress () const {
if (!mChatRoom) if (!mChatRoom)
return ""; return "";
return ::Utils::linphoneStringToQString( return ::Utils::coreStringToAppString(
mChatRoom->getPeerAddress()->asStringUriOnly() mChatRoom->getPeerAddress()->asStringUriOnly()
); );
} }
...@@ -435,14 +435,14 @@ void ChatModel::downloadFile (int id, const QString &downloadPath) { ...@@ -435,14 +435,14 @@ void ChatModel::downloadFile (int id, const QString &downloadPath) {
void ChatModel::fillMessageEntry (QVariantMap &dest, const shared_ptr<linphone::ChatMessage> &message) { void ChatModel::fillMessageEntry (QVariantMap &dest, const shared_ptr<linphone::ChatMessage> &message) {
dest["type"] = EntryType::MessageEntry; dest["type"] = EntryType::MessageEntry;
dest["timestamp"] = QDateTime::fromMSecsSinceEpoch(message->getTime() * 1000); dest["timestamp"] = QDateTime::fromMSecsSinceEpoch(message->getTime() * 1000);
dest["content"] = ::Utils::linphoneStringToQString(message->getText()); dest["content"] = ::Utils::coreStringToAppString(message->getText());
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<const 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::coreStringToAppString(content->getName());
fillThumbnailProperty(dest, message); fillThumbnailProperty(dest, message);
} }
} }
......
...@@ -96,7 +96,7 @@ void AbstractCodecsModel::setRecvFmtp (int id, const QString &recvFmtp) { ...@@ -96,7 +96,7 @@ void AbstractCodecsModel::setRecvFmtp (int id, const QString &recvFmtp) {
shared_ptr<linphone::PayloadType> codec = getCodecFromMap(map); shared_ptr<linphone::PayloadType> codec = getCodecFromMap(map);
codec->setRecvFmtp(::Utils::qStringToLinphoneString(recvFmtp)); codec->setRecvFmtp(::Utils::qStringToLinphoneString(recvFmtp));
map["recvFmtp"] = ::Utils::linphoneStringToQString(codec->getRecvFmtp()); map["recvFmtp"] = ::Utils::coreStringToAppString(codec->getRecvFmtp());
emit dataChanged(index(id, 0), index(id, 0)); emit dataChanged(index(id, 0), index(id, 0));
} }
...@@ -157,14 +157,14 @@ void AbstractCodecsModel::addCodec (shared_ptr<linphone::PayloadType> &codec) { ...@@ -157,14 +157,14 @@ void AbstractCodecsModel::addCodec (shared_ptr<linphone::PayloadType> &codec) {
map["bitrate"] = codec->getNormalBitrate(); map["bitrate"] = codec->getNormalBitrate();
map["channels"] = codec->getChannels(); map["channels"] = codec->getChannels();
map["clockRate"] = codec->getClockRate(); map["clockRate"] = codec->getClockRate();
map["description"] = ::Utils::linphoneStringToQString(codec->getDescription()); map["description"] = ::Utils::coreStringToAppString(codec->getDescription());
map["enabled"] = codec->enabled(); map["enabled"] = codec->enabled();
map["encoderDescription"] = ::Utils::linphoneStringToQString(codec->getEncoderDescription()); map["encoderDescription"] = ::Utils::coreStringToAppString(codec->getEncoderDescription());
map["isUsable"] = codec->isUsable(); map["isUsable"] = codec->isUsable();
map["isVbr"] = codec->isVbr(); map["isVbr"] = codec->isVbr();
map["mime"] = ::Utils::linphoneStringToQString(codec->getMimeType()); map["mime"] = ::Utils::coreStringToAppString(codec->getMimeType());
map["number"] = codec->getNumber(); map["number"] = codec->getNumber();
map["recvFmtp"] = ::Utils::linphoneStringToQString(codec->getRecvFmtp()); map["recvFmtp"] = ::Utils::coreStringToAppString(codec->getRecvFmtp());
map["__codec"] = QVariant::fromValue(codec); map["__codec"] = QVariant::fromValue(codec);
mCodecs << map; mCodecs << map;
......
...@@ -71,7 +71,7 @@ QVariant ConferenceHelperModel::ConferenceAddModel::data (const QModelIndex &ind ...@@ -71,7 +71,7 @@ QVariant ConferenceHelperModel::ConferenceAddModel::data (const QModelIndex &ind
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
bool ConferenceHelperModel::ConferenceAddModel::addToConference (const shared_ptr<const linphone::Address> &linphoneAddress) { bool ConferenceHelperModel::ConferenceAddModel::addToConference (const shared_ptr<const linphone::Address> &linphoneAddress) {
const QString &sipAddress = ::Utils::linphoneStringToQString(linphoneAddress->asStringUriOnly()); const QString &sipAddress = ::Utils::coreStringToAppString(linphoneAddress->asStringUriOnly());
if (mSipAddresses.contains(sipAddress)) if (mSipAddresses.contains(sipAddress))
return false; return false;
...@@ -145,7 +145,7 @@ void ConferenceHelperModel::ConferenceAddModel::update () { ...@@ -145,7 +145,7 @@ void ConferenceHelperModel::ConferenceAddModel::update () {
if (!call->getParams()->getLocalConferenceMode()) if (!call->getParams()->getLocalConferenceMode())
continue; continue;
const QString &sipAddress = ::Utils::linphoneStringToQString(call->getRemoteAddress()->asStringUriOnly()); const QString &sipAddress = ::Utils::coreStringToAppString(call->getRemoteAddress()->asStringUriOnly());
if (!mSipAddresses.contains(sipAddress)) if (!mSipAddresses.contains(sipAddress))
call->terminate(); call->terminate();
} }
...@@ -159,7 +159,7 @@ void ConferenceHelperModel::ConferenceAddModel::update () { ...@@ -159,7 +159,7 @@ void ConferenceHelperModel::ConferenceAddModel::update () {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void ConferenceHelperModel::ConferenceAddModel::addToConferencePrivate (const shared_ptr<linphone::Address> &linphoneAddress) { void ConferenceHelperModel::ConferenceAddModel::addToConferencePrivate (const shared_ptr<linphone::Address> &linphoneAddress) {
QString sipAddress = ::Utils::linphoneStringToQString(linphoneAddress->asStringUriOnly()); QString sipAddress = ::Utils::coreStringToAppString(linphoneAddress->asStringUriOnly());
QVariantMap map = CoreManager::getInstance()->getSipAddressesModel()->find(sipAddress); QVariantMap map = CoreManager::getInstance()->getSipAddressesModel()->find(sipAddress);
map["sipAddress"] = sipAddress; map["sipAddress"] = sipAddress;
......
...@@ -80,7 +80,7 @@ static void removeBelcardPhoto (const shared_ptr<belcard::BelCard> &belcard, boo ...@@ -80,7 +80,7 @@ static void removeBelcardPhoto (const shared_ptr<belcard::BelCard> &belcard, boo
for (const auto photo : photos) { for (const auto photo : photos) {
QString imagePath( QString imagePath(
::Utils::linphoneStringToQString( ::Utils::coreStringToAppString(
Paths::getAvatarsDirPath() + photo->getValue().substr(sizeof(VCARD_SCHEME) - 1) Paths::getAvatarsDirPath() + photo->getValue().substr(sizeof(VCARD_SCHEME) - 1)
) )
); );
...@@ -140,7 +140,7 @@ QString VcardModel::getAvatar () const { ...@@ -140,7 +140,7 @@ QString VcardModel::getAvatar () const {
// Returns right path. // Returns right path.
return QStringLiteral("image://%1/%2").arg(AvatarProvider::PROVIDER_ID).arg( return QStringLiteral("image://%1/%2").arg(AvatarProvider::PROVIDER_ID).arg(
::Utils::linphoneStringToQString(photo->getValue().substr(sizeof(VCARD_SCHEME) - 1)) ::Utils::coreStringToAppString(photo->getValue().substr(sizeof(VCARD_SCHEME) - 1))
); );
} }
...@@ -173,7 +173,7 @@ bool VcardModel::setAvatar (const QString &path) { ...@@ -173,7 +173,7 @@ bool VcardModel::setAvatar (const QString &path) {
.arg(uuid.mid(1, uuid.length() - 2)) // Remove `{}`. .arg(uuid.mid(1, uuid.length() - 2)) // Remove `{}`.
.arg(info.suffix()); .arg(info.suffix());
QString dest = ::Utils::linphoneStringToQString(Paths::getAvatarsDirPath()) + fileId; QString dest = ::Utils::coreStringToAppString(Paths::getAvatarsDirPath()) + fileId;
if (!file.copy(dest)) if (!file.copy(dest))
return false; return false;
...@@ -205,7 +205,7 @@ bool VcardModel::setAvatar (const QString &path) { ...@@ -205,7 +205,7 @@ bool VcardModel::setAvatar (const QString &path) {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString VcardModel::getUsername () const { QString VcardModel::getUsername () const {
return ::Utils::linphoneStringToQString(mVcard->getFullName()); return ::Utils::coreStringToAppString(mVcard->getFullName());
} }
void VcardModel::setUsername (const QString &username) { void VcardModel::setUsername (const QString &username) {
...@@ -242,10 +242,10 @@ QVariantMap VcardModel::getAddress () const { ...@@ -242,10 +242,10 @@ QVariantMap VcardModel::getAddress () const {
return map; return map;
shared_ptr<belcard::BelCardAddress> address = addresses.front(); shared_ptr<belcard::BelCardAddress> address = addresses.front();
map["street"] = ::Utils::linphoneStringToQString(address->getStreet()); map["street"] = ::Utils::coreStringToAppString(address->getStreet());
map["locality"] = ::Utils::linphoneStringToQString(address->getLocality()); map["locality"] = ::Utils::coreStringToAppString(address->getLocality());
map["postalCode"] = ::Utils::linphoneStringToQString(address->getPostalCode()); map["postalCode"] = ::Utils::coreStringToAppString(address->getPostalCode());
map["country"] = ::Utils::linphoneStringToQString(address->getCountry()); map["country"] = ::Utils::coreStringToAppString(address->getCountry());
return map; return map;
} }
...@@ -293,10 +293,10 @@ QVariantList VcardModel::getSipAddresses () const { ...@@ -293,10 +293,10 @@ QVariantList VcardModel::getSipAddresses () const {
shared_ptr<linphone::Address> linphoneAddress = core->createAddress(value); shared_ptr<linphone::Address> linphoneAddress = core->createAddress(value);
if (linphoneAddress) if (linphoneAddress)
list << ::Utils::linphoneStringToQString(linphoneAddress->asStringUriOnly()); list << ::Utils::coreStringToAppString(linphoneAddress->asStringUriOnly());
else else
qWarning() << QStringLiteral("Unable to parse sip address: `%1`") qWarning() << QStringLiteral("Unable to parse sip address: `%1`")
.arg(::Utils::linphoneStringToQString(value)); .arg(::Utils::coreStringToAppString(value));
} }
return list; return list;
...@@ -334,7 +334,7 @@ void VcardModel::removeSipAddress (const QString &sipAddress) { ...@@ -334,7 +334,7 @@ void VcardModel::removeSipAddress (const QString &sipAddress) {
shared_ptr<belcard::BelCard> belcard = mVcard->getVcard(); shared_ptr<belcard::BelCard> belcard = mVcard->getVcard();
list<shared_ptr<belcard::BelCardImpp> > addresses = belcard->getImpp(); list<shared_ptr<belcard::BelCardImpp> > addresses = belcard->getImpp();
shared_ptr<belcard::BelCardImpp> value = findBelCardValue( shared_ptr<belcard::BelCardImpp> value = findBelCardValue(
addresses, ::Utils::linphoneStringToQString(interpretSipAddress(sipAddress)) addresses, ::Utils::coreStringToAppString(interpretSipAddress(sipAddress))
); );
if (!value) { if (!value) {
...@@ -366,7 +366,7 @@ QVariantList VcardModel::getCompanies () const { ...@@ -366,7 +366,7 @@ QVariantList VcardModel::getCompanies () const {
QVariantList list; QVariantList list;
for (const auto &company : mVcard->getVcard()->getRoles()) for (const auto &company : mVcard->getVcard()->getRoles())
list.append(::Utils::linphoneStringToQString(company->getValue())); list.append(::Utils::coreStringToAppString(company->getValue()));
return list; return list;
} }
...@@ -420,7 +420,7 @@ QVariantList VcardModel::getEmails () const { ...@@ -420,7 +420,7 @@ QVariantList VcardModel::getEmails () const {
QVariantList list; QVariantList list;
for (const auto &email : mVcard->getVcard()->getEmails()) for (const auto &email : mVcard->getVcard()->getEmails())
list.append(::Utils::linphoneStringToQString(email->getValue())); list.append(::Utils::coreStringToAppString(email->getValue()));
return list; return list;
} }
...@@ -475,7 +475,7 @@ QVariantList VcardModel::getUrls () const { ...@@ -475,7 +475,7 @@ QVariantList VcardModel::getUrls () const {
QVariantList list; QVariantList list;
for (const auto &url : mVcard->getVcard()->getURLs()) for (const auto &url : mVcard->getVcard()->getURLs())
list.append(::Utils::linphoneStringToQString(url->getValue())); list.append(::Utils::coreStringToAppString(url->getValue()));
return list; return list;
} }
......
...@@ -134,7 +134,7 @@ float ContactsListProxyModel::computeContactWeight (const ContactModel *contact) ...@@ -134,7 +134,7 @@ float ContactsListProxyModel::computeContactWeight (const ContactModel *contact)
float size = static_cast<float>(addresses.size()); float size = static_cast<float>(addresses.size());
for (auto it = addresses.cbegin(); it != addresses.cend(); ++it) for (auto it = addresses.cbegin(); it != addresses.cend(); ++it)
weight += computeStringWeight( weight += computeStringWeight(
::Utils::linphoneStringToQString((*it)->asStringUriOnly()), ::Utils::coreStringToAppString((*it)->asStringUriOnly()),
SIP_ADDRESSES_WEIGHT / size SIP_ADDRESSES_WEIGHT / size
); );
......
...@@ -148,7 +148,7 @@ void CoreHandlers::onNotifyPresenceReceivedForUriOrTel ( ...@@ -148,7 +148,7 @@ void CoreHandlers::onNotifyPresenceReceivedForUriOrTel (
const string &uriOrTel, const string &uriOrTel,
const shared_ptr<const linphone::PresenceModel> &presenceModel const shared_ptr<const linphone::PresenceModel> &presenceModel
) { ) {
emit presenceReceived(::Utils::linphoneStringToQString(uriOrTel), presenceModel); emit presenceReceived(::Utils::coreStringToAppString(uriOrTel), presenceModel);
} }
void CoreHandlers::onNotifyPresenceReceived ( void CoreHandlers::onNotifyPresenceReceived (
......
...@@ -142,7 +142,7 @@ void CoreManager::createLinphoneCore (const QString &configPath) { ...@@ -142,7 +142,7 @@ void CoreManager::createLinphoneCore (const QString &configPath) {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString CoreManager::getVersion () const { QString CoreManager::getVersion () const {
return ::Utils::linphoneStringToQString(mCore->getVersion()); return ::Utils::coreStringToAppString(mCore->getVersion());
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
......
...@@ -230,8 +230,8 @@ void Notifier::notifyReceivedMessage (const shared_ptr<linphone::ChatMessage> &m ...@@ -230,8 +230,8 @@ void Notifier::notifyReceivedMessage (const shared_ptr<linphone::ChatMessage> &m
return; return;
QVariantMap map; QVariantMap map;
map["message"] = ::Utils::linphoneStringToQString(message->getText()); map["message"] = ::Utils::coreStringToAppString(message->getText());
map["sipAddress"] = ::Utils::linphoneStringToQString(message->getFromAddress()->asStringUriOnly()); map["sipAddress"] = ::Utils::coreStringToAppString(message->getFromAddress()->asStringUriOnly());
map["window"].setValue(App::getInstance()->getMainWindow()); map["window"].setValue(App::getInstance()->getMainWindow());
::setProperty(*notification, NOTIFICATION_PROPERTY_DATA, map); ::setProperty(*notification, NOTIFICATION_PROPERTY_DATA, map);
...@@ -244,7 +244,7 @@ void Notifier::notifyReceivedFileMessage (const shared_ptr<linphone::ChatMessage ...@@ -244,7 +244,7 @@ void Notifier::notifyReceivedFileMessage (const shared_ptr<linphone::ChatMessage
return; return;
QVariantMap map; QVariantMap map;
map["fileUri"] = ::Utils::linphoneStringToQString(message->getFileTransferFilepath()); map["fileUri"] = ::Utils::coreStringToAppString(message->getFileTransferFilepath());
map["fileSize"] = static_cast<quint64>(message->getFileTransferInformation()->getSize()); map["fileSize"] = static_cast<quint64>(message->getFileTransferInformation()->getSize());
::setProperty(*notification, NOTIFICATION_PROPERTY_DATA, map); ::setProperty(*notification, NOTIFICATION_PROPERTY_DATA, map);
......
...@@ -68,12 +68,12 @@ bool AccountSettingsModel::addOrUpdateProxyConfig (const shared_ptr<linphone::Pr ...@@ -68,12 +68,12 @@ bool AccountSettingsModel::addOrUpdateProxyConfig (const shared_ptr<linphone::Pr
if (find(proxyConfigs.cbegin(), proxyConfigs.cend(), proxyConfig) != proxyConfigs.cend()) { if (find(proxyConfigs.cbegin(), proxyConfigs.cend(), proxyConfig) != proxyConfigs.cend()) {
if (proxyConfig->done() == -1) { if (proxyConfig->done() == -1) {
qWarning() << QStringLiteral("Unable to update proxy config: `%1`.") qWarning() << QStringLiteral("Unable to update proxy config: `%1`.")
.arg(::Utils::linphoneStringToQString(proxyConfig->getIdentityAddress()->asString())); .arg(::Utils::coreStringToAppString(proxyConfig->getIdentityAddress()->asString()));
return false; return false;
} }
} else if (core->addProxyConfig(proxyConfig) == -1) { } else if (core->addProxyConfig(proxyConfig) == -1) {
qWarning() << QStringLiteral("Unable to add proxy config: `%1`.") qWarning() << QStringLiteral("Unable to add proxy config: `%1`.")
.arg(::Utils::linphoneStringToQString(proxyConfig->getIdentityAddress()->asString())); .arg(::Utils::coreStringToAppString(proxyConfig->getIdentityAddress()->asString()));
return false; return false;
} }
...@@ -90,15 +90,15 @@ QVariantMap AccountSettingsModel::getProxyConfigDescription (const shared_ptr<li ...@@ -90,15 +90,15 @@ QVariantMap AccountSettingsModel::getProxyConfigDescription (const shared_ptr<li
{ {
const shared_ptr<const linphone::Address> address = proxyConfig->getIdentityAddress(); const shared_ptr<const linphone::Address> address = proxyConfig->getIdentityAddress();
map["sipAddress"] = address map["sipAddress"] = address
? ::Utils::linphoneStringToQString(proxyConfig->getIdentityAddress()->asStringUriOnly()) ? ::Utils::coreStringToAppString(proxyConfig->getIdentityAddress()->asStringUriOnly())
: ""; : "";
} }
map["serverAddress"] = ::Utils::linphoneStringToQString(proxyConfig->getServerAddr()); map["serverAddress"] = ::Utils::coreStringToAppString(proxyConfig->getServerAddr());
map["registrationDuration"] = proxyConfig->getPublishExpires(); map["registrationDuration"] = proxyConfig->getPublishExpires();
map["transport"] = ::Utils::linphoneStringToQString(proxyConfig->getTransport()); map["transport"] = ::Utils::coreStringToAppString(proxyConfig->getTransport());
map["route"] = ::Utils::linphoneStringToQString(proxyConfig->getRoute()); map["route"] = ::Utils::coreStringToAppString(proxyConfig->getRoute());
map["contactParams"] = ::Utils::linphoneStringToQString(proxyConfig->getContactParameters()); map["contactParams"] = ::Utils::coreStringToAppString(proxyConfig->getContactParameters());
map["avpfInterval"] = proxyConfig->getAvpfRrInterval(); map["avpfInterval"] = proxyConfig->getAvpfRrInterval();
map["registerEnabled"] = proxyConfig->registerEnabled(); map["registerEnabled"] = proxyConfig->registerEnabled();
map["publishPresence"] = proxyConfig->publishEnabled(); map["publishPresence"] = proxyConfig->publishEnabled();
...@@ -190,7 +190,7 @@ QString AccountSettingsModel::getUsername () const { ...@@ -190,7 +190,7 @@ QString AccountSettingsModel::getUsername () const {
shared_ptr<const linphone::Address> address = getUsedSipAddress(); shared_ptr<const linphone::Address> address = getUsedSipAddress();
const string &displayName = address->getDisplayName(); const string &displayName = address->getDisplayName();
return ::Utils::linphoneStringToQString( return ::Utils::coreStringToAppString(
displayName.empty() ? address->getUsername() : displayName displayName.empty() ? address->getUsername() : displayName
); );
} }
...@@ -201,7 +201,7 @@ void AccountSettingsModel::setUsername (const QString &username) { ...@@ -201,7 +201,7 @@ void AccountSettingsModel::setUsername (const QString &username) {
if (newAddress->setDisplayName(::Utils::qStringToLinphoneString(username))) { if (newAddress->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(newAddress->asStringUriOnly())); .arg(::Utils::coreStringToAppString(newAddress->asStringUriOnly()));
} else { } else {
setUsedSipAddress(newAddress); setUsedSipAddress(newAddress);
} }
...@@ -210,7 +210,7 @@ void AccountSettingsModel::setUsername (const QString &username) { ...@@ -210,7 +210,7 @@ void AccountSettingsModel::setUsername (const QString &username) {
} }
QString AccountSettingsModel::getSipAddress () const { QString AccountSettingsModel::getSipAddress () const {
return ::Utils::linphoneStringToQString(getUsedSipAddress()->asStringUriOnly()); return ::Utils::coreStringToAppString(getUsedSipAddress()->asStringUriOnly());
} }
AccountSettingsModel::RegistrationState AccountSettingsModel::getRegistrationState () const { AccountSettingsModel::RegistrationState AccountSettingsModel::getRegistrationState () const {
...@@ -221,7 +221,7 @@ AccountSettingsModel::RegistrationState AccountSettingsModel::getRegistrationSta ...@@ -221,7 +221,7 @@ AccountSettingsModel::RegistrationState AccountSettingsModel::getRegistrationSta
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString AccountSettingsModel::getPrimaryUsername () const { QString AccountSettingsModel::getPrimaryUsername () const {
return ::Utils::linphoneStringToQString( return ::Utils::coreStringToAppString(
CoreManager::getInstance()->getCore()->getPrimaryContactParsed()->getUsername() CoreManager::getInstance()->getCore()->getPrimaryContactParsed()->getUsername()
); );
} }
...@@ -239,7 +239,7 @@ void AccountSettingsModel::setPrimaryUsername (const QString &username) { ...@@ -239,7 +239,7 @@ void AccountSettingsModel::setPrimaryUsername (const QString &username) {
} }
QString AccountSettingsModel::getPrimaryDisplayName () const { QString AccountSettingsModel::getPrimaryDisplayName () const {
return ::Utils::linphoneStringToQString( return ::Utils::coreStringToAppString(
CoreManager::getInstance()->getCore()->getPrimaryContactParsed()->getDisplayName() CoreManager::getInstance()->getCore()->getPrimaryContactParsed()->getDisplayName()
); );
} }
...@@ -255,7 +255,7 @@ void AccountSettingsModel::setPrimaryDisplayName (const QString &displayName) { ...@@ -255,7 +255,7 @@ void AccountSettingsModel::setPrimaryDisplayName (const QString &displayName) {
} }
QString AccountSettingsModel::getPrimarySipAddress () const { QString AccountSettingsModel::getPrimarySipAddress () const {
return ::Utils::linphoneStringToQString( return ::Utils::coreStringToAppString(
CoreManager::getInstance()->getCore()->getPrimaryContactParsed()->asString() CoreManager::getInstance()->getCore()->getPrimaryContactParsed()->asString()
); );
} }
...@@ -268,13 +268,13 @@ QVariantList AccountSettingsModel::getAccounts () const { ...@@ -268,13 +268,13 @@ QVariantList AccountSettingsModel::getAccounts () const {
{ {
QVariantMap account; QVariantMap account;
account["sipAddress"] = ::Utils::linphoneStringToQString(core->getPrimaryContactParsed()->asStringUriOnly()); account["sipAddress"] = ::Utils::coreStringToAppString(core->getPrimaryContactParsed()->asStringUriOnly());
accounts << account; accounts << account;
} }
for (const auto &proxyConfig : core->getProxyConfigList()) { for (const auto &proxyConfig : core->getProxyConfigList()) {
QVariantMap account; QVariantMap account;
account["sipAddress"] = ::Utils::linphoneStringToQString(proxyConfig->getIdentityAddress()->asStringUriOnly()); account["sipAddress"] = ::Utils::coreStringToAppString(proxyConfig->getIdentityAddress()->asStringUriOnly());
account["proxyConfig"].setValue(proxyConfig); account["proxyConfig"].setValue(proxyConfig);
accounts << account; accounts << account;
} }
......
...@@ -46,7 +46,7 @@ QStringList SettingsModel::getAudioDevices () const { ...@@ -46,7 +46,7 @@ QStringList SettingsModel::getAudioDevices () const {
QStringList list; QStringList list;
for (const auto &device : CoreManager::getInstance()->getCore()->getSoundDevices()) for (const auto &device : CoreManager::getInstance()->getCore()->getSoundDevices())
list << ::Utils::linphoneStringToQString(device); list << ::Utils::coreStringToAppString(device);
return list; return list;
} }
...@@ -54,7 +54,7 @@ QStringList SettingsModel::getAudioDevices () const { ...@@ -54,7 +54,7 @@ QStringList SettingsModel::getAudioDevices () const {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString SettingsModel::getCaptureDevice () const { QString SettingsModel::getCaptureDevice () const {
return ::Utils::linphoneStringToQString( return ::Utils::coreStringToAppString(
CoreManager::getInstance()->getCore()->getCaptureDevice() CoreManager::getInstance()->getCore()->getCaptureDevice()
); );
} }
...@@ -69,7 +69,7 @@ void SettingsModel::setCaptureDevice (const QString &device) { ...@@ -69,7 +69,7 @@ void SettingsModel::setCaptureDevice (const QString &device) {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString SettingsModel::getPlaybackDevice () const { QString SettingsModel::getPlaybackDevice () const {
return ::Utils::linphoneStringToQString( return ::Utils::coreStringToAppString(
CoreManager::getInstance()->getCore()->getPlaybackDevice() CoreManager::getInstance()->getCore()->getPlaybackDevice()
); );
} }
...@@ -84,7 +84,7 @@ void SettingsModel::setPlaybackDevice (const QString &device) { ...@@ -84,7 +84,7 @@ void SettingsModel::setPlaybackDevice (const QString &device) {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString SettingsModel::getRingerDevice () const { QString SettingsModel::getRingerDevice () const {
return ::Utils::linphoneStringToQString( return ::Utils::coreStringToAppString(
CoreManager::getInstance()->getCore()->getRingerDevice() CoreManager::getInstance()->getCore()->getRingerDevice()
); );
} }
...@@ -99,7 +99,7 @@ void SettingsModel::setRingerDevice (const QString &device) { ...@@ -99,7 +99,7 @@ void SettingsModel::setRingerDevice (const QString &device) {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString SettingsModel::getRingPath () const { QString SettingsModel::getRingPath () const {
return ::Utils::linphoneStringToQString(CoreManager::getInstance()->getCore()->getRing()); return ::Utils::coreStringToAppString(CoreManager::getInstance()->getCore()->getRing());
} }
void SettingsModel::setRingPath (const QString &path) { void SettingsModel::setRingPath (const QString &path) {
...@@ -131,7 +131,7 @@ QStringList SettingsModel::getVideoDevices () const { ...@@ -131,7 +131,7 @@ QStringList SettingsModel::getVideoDevices () const {
QStringList list; QStringList list;
for (const auto &device : CoreManager::getInstance()->getCore()->getVideoDevices()) for (const auto &device : CoreManager::getInstance()->getCore()->getVideoDevices())
list << ::Utils::linphoneStringToQString(device); list << ::Utils::coreStringToAppString(device);
return list; return list;
} }
...@@ -139,7 +139,7 @@ QStringList SettingsModel::getVideoDevices () const { ...@@ -139,7 +139,7 @@ QStringList SettingsModel::getVideoDevices () const {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString SettingsModel::getVideoDevice () const { QString SettingsModel::getVideoDevice () const {
return ::Utils::linphoneStringToQString( return ::Utils::coreStringToAppString(
CoreManager::getInstance()->getCore()->getVideoDevice() CoreManager::getInstance()->getCore()->getVideoDevice()
); );
} }
...@@ -154,7 +154,7 @@ void SettingsModel::setVideoDevice (const QString &device) { ...@@ -154,7 +154,7 @@ void SettingsModel::setVideoDevice (const QString &device) {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString SettingsModel::getVideoPreset () const { QString SettingsModel::getVideoPreset () const {
return ::Utils::linphoneStringToQString( return ::Utils::coreStringToAppString(
CoreManager::getInstance()->getCore()->getVideoPreset() CoreManager::getInstance()->getCore()->getVideoPreset()
); );
} }
...@@ -182,7 +182,7 @@ void SettingsModel::setVideoFramerate (int framerate) { ...@@ -182,7 +182,7 @@ void SettingsModel::setVideoFramerate (int framerate) {
inline QVariantMap createMapFromVideoDefinition (const shared_ptr<const linphone::VideoDefinition> &definition) { inline QVariantMap createMapFromVideoDefinition (const shared_ptr<const linphone::VideoDefinition> &definition) {
QVariantMap map; QVariantMap map;
map["name"] = ::Utils::linphoneStringToQString(definition->getName()); map["name"] = ::Utils::coreStringToAppString(definition->getName());
map["width"] = definition->getWidth(); map["width"] = definition->getWidth();
map["height"] = definition->getHeight(); map["height"] = definition->getHeight();
map["__definition"] = QVariant::fromValue(definition); map["__definition"] = QVariant::fromValue(definition);
...@@ -236,7 +236,7 @@ void SettingsModel::setAutoAnswerStatus (bool status) { ...@@ -236,7 +236,7 @@ void SettingsModel::setAutoAnswerStatus (bool status) {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString SettingsModel::getFileTransferUrl () const { QString SettingsModel::getFileTransferUrl () const {
return ::Utils::linphoneStringToQString( return ::Utils::coreStringToAppString(
CoreManager::getInstance()->getCore()->getFileTransferServer() CoreManager::getInstance()->getCore()->getFileTransferServer()
); );
} }
...@@ -523,7 +523,7 @@ void SettingsModel::setTurnEnabled (bool status) { ...@@ -523,7 +523,7 @@ void SettingsModel::setTurnEnabled (bool status) {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString SettingsModel::getStunServer () const { QString SettingsModel::getStunServer () const {
return ::Utils::linphoneStringToQString( return ::Utils::coreStringToAppString(
CoreManager::getInstance()->getCore()->getNatPolicy()->getStunServer() CoreManager::getInstance()->getCore()->getNatPolicy()->getStunServer()
); );
} }
...@@ -537,7 +537,7 @@ void SettingsModel::setStunServer (const QString &stunServer) { ...@@ -537,7 +537,7 @@ void SettingsModel::setStunServer (const QString &stunServer) {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString SettingsModel::getTurnUser () const { QString SettingsModel::getTurnUser () const {
return ::Utils::linphoneStringToQString( return ::Utils::coreStringToAppString(
CoreManager::getInstance()->getCore()->getNatPolicy()->getStunServerUsername() CoreManager::getInstance()->getCore()->getNatPolicy()->getStunServerUsername()
); );
} }
...@@ -557,7 +557,7 @@ QString SettingsModel::getTurnPassword () const { ...@@ -557,7 +557,7 @@ QString SettingsModel::getTurnPassword () const {
shared_ptr<linphone::NatPolicy> natPolicy = core->getNatPolicy(); shared_ptr<linphone::NatPolicy> natPolicy = core->getNatPolicy();
shared_ptr<const linphone::AuthInfo> authInfo = core->findAuthInfo(natPolicy->getStunServerUsername(), "", ""); shared_ptr<const linphone::AuthInfo> authInfo = core->findAuthInfo(natPolicy->getStunServerUsername(), "", "");
return authInfo ? ::Utils::linphoneStringToQString(authInfo->getPasswd()) : ""; return authInfo ? ::Utils::coreStringToAppString(authInfo->getPasswd()) : "";
} }
void SettingsModel::setTurnPassword (const QString &password) { void SettingsModel::setTurnPassword (const QString &password) {
...@@ -616,7 +616,7 @@ void SettingsModel::setDscpVideo (int dscp) { ...@@ -616,7 +616,7 @@ void SettingsModel::setDscpVideo (int dscp) {
QString SettingsModel::getSavedScreenshotsFolder () const { QString SettingsModel::getSavedScreenshotsFolder () const {
return QDir::cleanPath( return QDir::cleanPath(
::Utils::linphoneStringToQString( ::Utils::coreStringToAppString(
mConfig->getString(UI_SECTION, "saved_screenshots_folder", Paths::getCapturesDirPath()) mConfig->getString(UI_SECTION, "saved_screenshots_folder", Paths::getCapturesDirPath())
) )
) + QDir::separator(); ) + QDir::separator();
...@@ -633,7 +633,7 @@ void SettingsModel::setSavedScreenshotsFolder (const QString &folder) { ...@@ -633,7 +633,7 @@ void SettingsModel::setSavedScreenshotsFolder (const QString &folder) {
QString SettingsModel::getSavedVideosFolder () const { QString SettingsModel::getSavedVideosFolder () const {
return QDir::cleanPath( return QDir::cleanPath(
::Utils::linphoneStringToQString( ::Utils::coreStringToAppString(
mConfig->getString(UI_SECTION, "saved_videos_folder", Paths::getCapturesDirPath()) mConfig->getString(UI_SECTION, "saved_videos_folder", Paths::getCapturesDirPath())
) )
) + QDir::separator(); ) + QDir::separator();
...@@ -649,7 +649,7 @@ void SettingsModel::setSavedVideosFolder (const QString &folder) { ...@@ -649,7 +649,7 @@ void SettingsModel::setSavedVideosFolder (const QString &folder) {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString SettingsModel::getRemoteProvisioning () const { QString SettingsModel::getRemoteProvisioning () const {
return ::Utils::linphoneStringToQString(CoreManager::getInstance()->getCore()->getProvisioningUri()); return ::Utils::coreStringToAppString(CoreManager::getInstance()->getCore()->getProvisioningUri());
} }
void SettingsModel::setRemoteProvisioning (const QString &remoteProvisioning) { void SettingsModel::setRemoteProvisioning (const QString &remoteProvisioning) {
......
...@@ -145,7 +145,7 @@ QString SipAddressesModel::interpretUrl (const QString &sipAddress) const { ...@@ -145,7 +145,7 @@ QString SipAddressesModel::interpretUrl (const QString &sipAddress) const {
::Utils::qStringToLinphoneString(sipAddress) ::Utils::qStringToLinphoneString(sipAddress)
); );
return lAddress ? ::Utils::linphoneStringToQString(lAddress->asStringUriOnly()) : ""; return lAddress ? ::Utils::coreStringToAppString(lAddress->asStringUriOnly()) : "";
} }
QString SipAddressesModel::getTransportFromSipAddress (const QString &sipAddress) const { QString SipAddressesModel::getTransportFromSipAddress (const QString &sipAddress) const {
...@@ -188,7 +188,7 @@ QString SipAddressesModel::addTransportToSipAddress (const QString &sipAddress, ...@@ -188,7 +188,7 @@ QString SipAddressesModel::addTransportToSipAddress (const QString &sipAddress,
else else
address->setTransport(linphone::TransportType::TransportTypeDtls); address->setTransport(linphone::TransportType::TransportTypeDtls);
return ::Utils::linphoneStringToQString(address->asString()); return ::Utils::coreStringToAppString(address->asString());
} }
bool SipAddressesModel::sipAddressIsValid (const QString &sipAddress) { bool SipAddressesModel::sipAddressIsValid (const QString &sipAddress) {
...@@ -257,7 +257,7 @@ void SipAddressesModel::handleSipAddressRemoved (ContactModel *contact, const QS ...@@ -257,7 +257,7 @@ void SipAddressesModel::handleSipAddressRemoved (ContactModel *contact, const QS
} }
void SipAddressesModel::handleMessageReceived (const shared_ptr<linphone::ChatMessage> &message) { void SipAddressesModel::handleMessageReceived (const shared_ptr<linphone::ChatMessage> &message) {
const QString &sipAddress = ::Utils::linphoneStringToQString(message->getFromAddress()->asStringUriOnly()); const QString &sipAddress = ::Utils::coreStringToAppString(message->getFromAddress()->asStringUriOnly());
addOrUpdateSipAddress(sipAddress, message); addOrUpdateSipAddress(sipAddress, message);
} }
...@@ -271,7 +271,7 @@ void SipAddressesModel::handleCallStateChanged ( ...@@ -271,7 +271,7 @@ void SipAddressesModel::handleCallStateChanged (
if (state == linphone::CallStateEnd || state == linphone::CallStateError) if (state == linphone::CallStateEnd || state == linphone::CallStateError)
addOrUpdateSipAddress( addOrUpdateSipAddress(
::Utils::linphoneStringToQString(call->getRemoteAddress()->asStringUriOnly()), call ::Utils::coreStringToAppString(call->getRemoteAddress()->asStringUriOnly()), call
); );
} }
...@@ -332,7 +332,7 @@ void SipAddressesModel::handleAllEntriesRemoved (const QString &sipAddress) { ...@@ -332,7 +332,7 @@ void SipAddressesModel::handleAllEntriesRemoved (const QString &sipAddress) {
void SipAddressesModel::handleMessageSent (const shared_ptr<linphone::ChatMessage> &message) { void SipAddressesModel::handleMessageSent (const shared_ptr<linphone::ChatMessage> &message) {
addOrUpdateSipAddress( addOrUpdateSipAddress(
::Utils::linphoneStringToQString(message->getToAddress()->asStringUriOnly()), ::Utils::coreStringToAppString(message->getToAddress()->asStringUriOnly()),
message message
); );
} }
...@@ -448,7 +448,7 @@ void SipAddressesModel::initSipAddresses () { ...@@ -448,7 +448,7 @@ void SipAddressesModel::initSipAddresses () {
if (history.size() == 0) if (history.size() == 0)
continue; continue;
QString sipAddress = ::Utils::linphoneStringToQString(chatRoom->getPeerAddress()->asStringUriOnly()); QString sipAddress = ::Utils::coreStringToAppString(chatRoom->getPeerAddress()->asStringUriOnly());
QVariantMap map; QVariantMap map;
map["sipAddress"] = sipAddress; map["sipAddress"] = sipAddress;
...@@ -461,7 +461,7 @@ void SipAddressesModel::initSipAddresses () { ...@@ -461,7 +461,7 @@ void SipAddressesModel::initSipAddresses () {
// Get sip addresses from calls. // Get sip addresses from calls.
QSet<QString> addressDone; QSet<QString> addressDone;
for (const auto &callLog : core->getCallLogs()) { for (const auto &callLog : core->getCallLogs()) {
const QString &sipAddress = ::Utils::linphoneStringToQString(callLog->getRemoteAddress()->asStringUriOnly()); const QString &sipAddress = ::Utils::coreStringToAppString(callLog->getRemoteAddress()->asStringUriOnly());
if (addressDone.contains(sipAddress)) if (addressDone.contains(sipAddress))
continue; // Already used. continue; // Already used.
......
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