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

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

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