Commit a346aedd authored by Ronan Abhamon's avatar Ronan Abhamon

feat(app): replace `qStringToLinphoneString` to `appStringToCoreString`

parent 0eaa2521
...@@ -33,23 +33,10 @@ namespace Utils { ...@@ -33,23 +33,10 @@ namespace Utils {
return QString::fromLocal8Bit(string.c_str(), static_cast<int>(string.size())); return QString::fromLocal8Bit(string.c_str(), static_cast<int>(string.size()));
} }
inline std::string qStringToLinphoneString (const QString &string) { inline std::string appStringToCoreString (const QString &string) {
return string.toLocal8Bit().constData(); return string.toLocal8Bit().constData();
} }
template<class T>
T *findParentType (const QObject *object) {
QObject *parent = object->parent();
if (!parent)
return nullptr;
T *found = qobject_cast<T *>(parent);
if (found)
return found;
return findParentType<T>(parent);
}
// Reverse function of strstr. // Reverse function of strstr.
char *rstrstr (const char *a, const char *b); char *rstrstr (const char *a, const char *b);
} }
......
...@@ -444,7 +444,7 @@ QString App::getConfigLocale () const { ...@@ -444,7 +444,7 @@ QString App::getConfigLocale () const {
void App::setConfigLocale (const QString &locale) { void App::setConfigLocale (const QString &locale) {
CoreManager::getInstance()->getCore()->getConfig()->setString( CoreManager::getInstance()->getCore()->getConfig()->setString(
SettingsModel::UI_SECTION, "locale", ::Utils::qStringToLinphoneString(locale) SettingsModel::UI_SECTION, "locale", ::Utils::appStringToCoreString(locale)
); );
emit configLocaleChanged(locale); emit configLocaleChanged(locale);
......
...@@ -80,7 +80,7 @@ inline void ensureFilePathExists (const QString &path) { ...@@ -80,7 +80,7 @@ inline void ensureFilePathExists (const QString &path) {
} }
inline string getReadableDirPath (const QString &dirname) { inline string getReadableDirPath (const QString &dirname) {
return Utils::qStringToLinphoneString(QDir::toNativeSeparators(dirname)); return Utils::appStringToCoreString(QDir::toNativeSeparators(dirname));
} }
inline string getWritableDirPath (const QString &dirname) { inline string getWritableDirPath (const QString &dirname) {
...@@ -89,7 +89,7 @@ inline string getWritableDirPath (const QString &dirname) { ...@@ -89,7 +89,7 @@ inline string getWritableDirPath (const QString &dirname) {
} }
inline string getReadableFilePath (const QString &filename) { inline string getReadableFilePath (const QString &filename) {
return Utils::qStringToLinphoneString(QDir::toNativeSeparators(filename)); return Utils::appStringToCoreString(QDir::toNativeSeparators(filename));
} }
inline string getWritableFilePath (const QString &filename) { inline string getWritableFilePath (const QString &filename) {
......
...@@ -198,7 +198,7 @@ void AssistantModel::setEmail (const QString &email) { ...@@ -198,7 +198,7 @@ void AssistantModel::setEmail (const QString &email) {
shared_ptr<linphone::Config> config = CoreManager::getInstance()->getCore()->getConfig(); shared_ptr<linphone::Config> config = CoreManager::getInstance()->getCore()->getConfig();
QString error; QString error;
switch (mAccountCreator->setEmail(::Utils::qStringToLinphoneString(email))) { switch (mAccountCreator->setEmail(::Utils::appStringToCoreString(email))) {
case linphone::AccountCreatorEmailStatusOk: case linphone::AccountCreatorEmailStatusOk:
break; break;
case linphone::AccountCreatorEmailStatusMalformed: case linphone::AccountCreatorEmailStatusMalformed:
...@@ -222,7 +222,7 @@ void AssistantModel::setPassword (const QString &password) { ...@@ -222,7 +222,7 @@ void AssistantModel::setPassword (const QString &password) {
shared_ptr<linphone::Config> config = CoreManager::getInstance()->getCore()->getConfig(); shared_ptr<linphone::Config> config = CoreManager::getInstance()->getCore()->getConfig();
QString error; QString error;
switch (mAccountCreator->setPassword(::Utils::qStringToLinphoneString(password))) { switch (mAccountCreator->setPassword(::Utils::appStringToCoreString(password))) {
case linphone::AccountCreatorPasswordStatusOk: case linphone::AccountCreatorPasswordStatusOk:
break; break;
case linphone::AccountCreatorPasswordStatusTooShort: case linphone::AccountCreatorPasswordStatusTooShort:
...@@ -269,7 +269,7 @@ void AssistantModel::setUsername (const QString &username) { ...@@ -269,7 +269,7 @@ void AssistantModel::setUsername (const QString &username) {
emit usernameChanged( emit usernameChanged(
username, username,
mapAccountCreatorUsernameStatusToString( mapAccountCreatorUsernameStatusToString(
mAccountCreator->setUsername(::Utils::qStringToLinphoneString(username)) mAccountCreator->setUsername(::Utils::appStringToCoreString(username))
) )
); );
} }
...@@ -284,7 +284,7 @@ void AssistantModel::setDisplayName (const QString &displayName) { ...@@ -284,7 +284,7 @@ void AssistantModel::setDisplayName (const QString &displayName) {
emit displayNameChanged( emit displayNameChanged(
displayName, displayName,
mapAccountCreatorUsernameStatusToString( mapAccountCreatorUsernameStatusToString(
mAccountCreator->setDisplayName(::Utils::qStringToLinphoneString(displayName)) mAccountCreator->setDisplayName(::Utils::appStringToCoreString(displayName))
) )
); );
} }
...@@ -302,7 +302,7 @@ void AssistantModel::setConfigFilename (const QString &configFilename) { ...@@ -302,7 +302,7 @@ void AssistantModel::setConfigFilename (const QString &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(
::Utils::qStringToLinphoneString(configPath) ::Utils::appStringToCoreString(configPath)
); );
emit configFilenameChanged(configFilename); emit configFilenameChanged(configFilename);
......
...@@ -78,7 +78,7 @@ QString CallModel::getSipAddress () const { ...@@ -78,7 +78,7 @@ QString CallModel::getSipAddress () const {
void CallModel::setRecordFile (shared_ptr<linphone::CallParams> &callParams) { void CallModel::setRecordFile (shared_ptr<linphone::CallParams> &callParams) {
callParams->setRecordFile( callParams->setRecordFile(
::Utils::qStringToLinphoneString( ::Utils::appStringToCoreString(
QStringLiteral("%1%2.mkv") QStringLiteral("%1%2.mkv")
.arg(CoreManager::getInstance()->getSettingsModel()->getSavedVideosFolder()) .arg(CoreManager::getInstance()->getSettingsModel()->getSavedVideosFolder())
.arg(QDateTime::currentDateTime().toString("yyyy-MM-dd_hh:mm:ss")) .arg(QDateTime::currentDateTime().toString("yyyy-MM-dd_hh:mm:ss"))
...@@ -142,7 +142,7 @@ void CallModel::askForTransfer () { ...@@ -142,7 +142,7 @@ void CallModel::askForTransfer () {
} }
bool CallModel::transferTo (const QString &sipAddress) { bool CallModel::transferTo (const QString &sipAddress) {
bool status = !!mCall->transfer(::Utils::qStringToLinphoneString(sipAddress)); bool status = !!mCall->transfer(::Utils::appStringToCoreString(sipAddress));
if (status) if (status)
qWarning() << QStringLiteral("Unable to transfer: `%1`.").arg(sipAddress); qWarning() << QStringLiteral("Unable to transfer: `%1`.").arg(sipAddress);
return status; return status;
...@@ -176,7 +176,7 @@ void CallModel::takeSnapshot () { ...@@ -176,7 +176,7 @@ void CallModel::takeSnapshot () {
qInfo() << QStringLiteral("Take snapshot of call:") << this; qInfo() << QStringLiteral("Take snapshot of call:") << this;
mCall->takeVideoSnapshot( mCall->takeVideoSnapshot(
::Utils::qStringToLinphoneString( ::Utils::appStringToCoreString(
CoreManager::getInstance()->getSettingsModel()->getSavedScreenshotsFolder() + newName CoreManager::getInstance()->getSettingsModel()->getSavedScreenshotsFolder() + newName
) )
); );
......
...@@ -93,7 +93,7 @@ void CallsListModel::askForTransfer (CallModel *callModel) { ...@@ -93,7 +93,7 @@ void CallsListModel::askForTransfer (CallModel *callModel) {
void CallsListModel::launchAudioCall (const QString &sipUri) const { void CallsListModel::launchAudioCall (const QString &sipUri) const {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore(); shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
shared_ptr<linphone::Address> address = core->interpretUrl(::Utils::qStringToLinphoneString(sipUri)); shared_ptr<linphone::Address> address = core->interpretUrl(::Utils::appStringToCoreString(sipUri));
if (!address) if (!address)
return; return;
...@@ -107,7 +107,7 @@ void CallsListModel::launchAudioCall (const QString &sipUri) const { ...@@ -107,7 +107,7 @@ void CallsListModel::launchAudioCall (const QString &sipUri) const {
void CallsListModel::launchVideoCall (const QString &sipUri) const { void CallsListModel::launchVideoCall (const QString &sipUri) const {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore(); shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
shared_ptr<linphone::Address> address = core->interpretUrl(::Utils::qStringToLinphoneString(sipUri)); shared_ptr<linphone::Address> address = core->interpretUrl(::Utils::appStringToCoreString(sipUri));
if (!address) if (!address)
return; return;
......
...@@ -78,7 +78,7 @@ inline void createThumbnail (const shared_ptr<linphone::ChatMessage> &message) { ...@@ -78,7 +78,7 @@ inline void createThumbnail (const shared_ptr<linphone::ChatMessage> &message) {
return; return;
} }
message->setAppdata(::Utils::qStringToLinphoneString(fileId)); message->setAppdata(::Utils::appStringToCoreString(fileId));
} }
inline void removeFileMessageThumbnail (const shared_ptr<linphone::ChatMessage> &message) { inline void removeFileMessageThumbnail (const shared_ptr<linphone::ChatMessage> &message) {
...@@ -259,7 +259,7 @@ void ChatModel::setSipAddress (const QString &sipAddress) { ...@@ -259,7 +259,7 @@ void ChatModel::setSipAddress (const QString &sipAddress) {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore(); shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
mChatRoom = core->getChatRoomFromUri(::Utils::qStringToLinphoneString(sipAddress)); mChatRoom = core->getChatRoomFromUri(::Utils::appStringToCoreString(sipAddress));
if (mChatRoom->getUnreadMessagesCount() > 0) if (mChatRoom->getUnreadMessagesCount() > 0)
resetMessagesCount(); resetMessagesCount();
...@@ -316,7 +316,7 @@ void ChatModel::sendMessage (const QString &message) { ...@@ -316,7 +316,7 @@ void ChatModel::sendMessage (const QString &message) {
if (!mChatRoom) if (!mChatRoom)
return; return;
shared_ptr<linphone::ChatMessage> _message = mChatRoom->createMessage(::Utils::qStringToLinphoneString(message)); shared_ptr<linphone::ChatMessage> _message = mChatRoom->createMessage(::Utils::appStringToCoreString(message));
_message->setListener(mMessageHandlers); _message->setListener(mMessageHandlers);
insertMessageAtEnd(_message); insertMessageAtEnd(_message);
...@@ -376,10 +376,10 @@ void ChatModel::sendFileMessage (const QString &path) { ...@@ -376,10 +376,10 @@ void ChatModel::sendFileMessage (const QString &path) {
content->setSubtype("octet-stream"); content->setSubtype("octet-stream");
content->setSize(static_cast<size_t>(fileSize)); content->setSize(static_cast<size_t>(fileSize));
content->setName(::Utils::qStringToLinphoneString(QFileInfo(file).fileName())); content->setName(::Utils::appStringToCoreString(QFileInfo(file).fileName()));
shared_ptr<linphone::ChatMessage> message = mChatRoom->createFileTransferMessage(content); shared_ptr<linphone::ChatMessage> message = mChatRoom->createFileTransferMessage(content);
message->setFileTransferFilepath(::Utils::qStringToLinphoneString(path)); message->setFileTransferFilepath(::Utils::appStringToCoreString(path));
message->setListener(mMessageHandlers); message->setListener(mMessageHandlers);
createThumbnail(message); createThumbnail(message);
...@@ -423,7 +423,7 @@ void ChatModel::downloadFile (int id, const QString &downloadPath) { ...@@ -423,7 +423,7 @@ void ChatModel::downloadFile (int id, const QString &downloadPath) {
return; return;
} }
message->setFileTransferFilepath(::Utils::qStringToLinphoneString(downloadPath)); message->setFileTransferFilepath(::Utils::appStringToCoreString(downloadPath));
message->setListener(mMessageHandlers); message->setListener(mMessageHandlers);
if (message->downloadFile() < 0) if (message->downloadFile() < 0)
......
...@@ -95,7 +95,7 @@ void AbstractCodecsModel::setRecvFmtp (int id, const QString &recvFmtp) { ...@@ -95,7 +95,7 @@ void AbstractCodecsModel::setRecvFmtp (int id, const QString &recvFmtp) {
QVariantMap &map = mCodecs[id]; QVariantMap &map = mCodecs[id];
shared_ptr<linphone::PayloadType> codec = getCodecFromMap(map); shared_ptr<linphone::PayloadType> codec = getCodecFromMap(map);
codec->setRecvFmtp(::Utils::qStringToLinphoneString(recvFmtp)); codec->setRecvFmtp(::Utils::appStringToCoreString(recvFmtp));
map["recvFmtp"] = ::Utils::coreStringToAppString(codec->getRecvFmtp()); map["recvFmtp"] = ::Utils::coreStringToAppString(codec->getRecvFmtp());
emit dataChanged(index(id, 0), index(id, 0)); emit dataChanged(index(id, 0), index(id, 0));
......
...@@ -96,7 +96,7 @@ bool ConferenceHelperModel::ConferenceAddModel::addToConference (const QString & ...@@ -96,7 +96,7 @@ bool ConferenceHelperModel::ConferenceAddModel::addToConference (const QString &
qInfo() << QStringLiteral("Add sip address to conference: `%1`.").arg(sipAddress); qInfo() << QStringLiteral("Add sip address to conference: `%1`.").arg(sipAddress);
shared_ptr<linphone::Address> linphoneAddress = CoreManager::getInstance()->getCore()->interpretUrl( shared_ptr<linphone::Address> linphoneAddress = CoreManager::getInstance()->getCore()->interpretUrl(
::Utils::qStringToLinphoneString(sipAddress) ::Utils::appStringToCoreString(sipAddress)
); );
addToConferencePrivate(linphoneAddress); addToConferencePrivate(linphoneAddress);
......
...@@ -71,7 +71,7 @@ void ConferenceModel::startRecording () { ...@@ -71,7 +71,7 @@ void ConferenceModel::startRecording () {
CoreManager *coreManager = CoreManager::getInstance(); CoreManager *coreManager = CoreManager::getInstance();
coreManager->getCore()->startConferenceRecording( coreManager->getCore()->startConferenceRecording(
::Utils::qStringToLinphoneString( ::Utils::appStringToCoreString(
QStringLiteral("%1%2.mkv") QStringLiteral("%1%2.mkv")
.arg(coreManager->getSettingsModel()->getSavedVideosFolder()) .arg(coreManager->getSettingsModel()->getSavedVideosFolder())
.arg(QDateTime::currentDateTime().toString("yyyy-MM-dd_hh:mm:ss")) .arg(QDateTime::currentDateTime().toString("yyyy-MM-dd_hh:mm:ss"))
......
...@@ -55,7 +55,7 @@ inline shared_ptr<T> findBelCardValue (const list<shared_ptr<T> > &list, const s ...@@ -55,7 +55,7 @@ inline shared_ptr<T> findBelCardValue (const list<shared_ptr<T> > &list, const s
template<class T> template<class T>
inline shared_ptr<T> findBelCardValue (const list<shared_ptr<T> > &list, const QString &value) { inline shared_ptr<T> findBelCardValue (const list<shared_ptr<T> > &list, const QString &value) {
return findBelCardValue(list, ::Utils::qStringToLinphoneString(value)); return findBelCardValue(list, ::Utils::appStringToCoreString(value));
} }
inline bool isLinphoneDesktopPhoto (const shared_ptr<belcard::BelCardPhoto> &photo) { inline bool isLinphoneDesktopPhoto (const shared_ptr<belcard::BelCardPhoto> &photo) {
...@@ -100,7 +100,7 @@ static string interpretSipAddress (const QString &sipAddress) { ...@@ -100,7 +100,7 @@ static string interpretSipAddress (const QString &sipAddress) {
string out; string out;
shared_ptr<linphone::Address> linphoneAddress = CoreManager::getInstance()->getCore()->interpretUrl( shared_ptr<linphone::Address> linphoneAddress = CoreManager::getInstance()->getCore()->interpretUrl(
::Utils::qStringToLinphoneString(sipAddress) ::Utils::appStringToCoreString(sipAddress)
); );
if (!linphoneAddress) { if (!linphoneAddress) {
...@@ -189,7 +189,7 @@ bool VcardModel::setAvatar (const QString &path) { ...@@ -189,7 +189,7 @@ bool VcardModel::setAvatar (const QString &path) {
// 3. Update new photo. // 3. Update new photo.
if (!path.isEmpty()) { if (!path.isEmpty()) {
shared_ptr<belcard::BelCardPhoto> photo = belcard::BelCardGeneric::create<belcard::BelCardPhoto>(); shared_ptr<belcard::BelCardPhoto> photo = belcard::BelCardGeneric::create<belcard::BelCardPhoto>();
photo->setValue(VCARD_SCHEME + ::Utils::qStringToLinphoneString(fileId)); photo->setValue(VCARD_SCHEME + ::Utils::appStringToCoreString(fileId));
if (!belcard->addPhoto(photo)) { if (!belcard->addPhoto(photo)) {
file.remove(); file.remove();
...@@ -214,7 +214,7 @@ void VcardModel::setUsername (const QString &username) { ...@@ -214,7 +214,7 @@ void VcardModel::setUsername (const QString &username) {
if (username.length() == 0 || username == getUsername()) if (username.length() == 0 || username == getUsername())
return; return;
mVcard->setFullName(::Utils::qStringToLinphoneString(username)); mVcard->setFullName(::Utils::appStringToCoreString(username));
emit vcardUpdated(); emit vcardUpdated();
} }
...@@ -254,7 +254,7 @@ void VcardModel::setStreet (const QString &street) { ...@@ -254,7 +254,7 @@ void VcardModel::setStreet (const QString &street) {
CHECK_VCARD_IS_WRITABLE(this); CHECK_VCARD_IS_WRITABLE(this);
shared_ptr<belcard::BelCardAddress> address = getOrCreateBelCardAddress(mVcard->getVcard()); shared_ptr<belcard::BelCardAddress> address = getOrCreateBelCardAddress(mVcard->getVcard());
address->setStreet(::Utils::qStringToLinphoneString(street)); address->setStreet(::Utils::appStringToCoreString(street));
emit vcardUpdated(); emit vcardUpdated();
} }
...@@ -262,7 +262,7 @@ void VcardModel::setLocality (const QString &locality) { ...@@ -262,7 +262,7 @@ void VcardModel::setLocality (const QString &locality) {
CHECK_VCARD_IS_WRITABLE(this); CHECK_VCARD_IS_WRITABLE(this);
shared_ptr<belcard::BelCardAddress> address = getOrCreateBelCardAddress(mVcard->getVcard()); shared_ptr<belcard::BelCardAddress> address = getOrCreateBelCardAddress(mVcard->getVcard());
address->setLocality(::Utils::qStringToLinphoneString(locality)); address->setLocality(::Utils::appStringToCoreString(locality));
emit vcardUpdated(); emit vcardUpdated();
} }
...@@ -270,7 +270,7 @@ void VcardModel::setPostalCode (const QString &postalCode) { ...@@ -270,7 +270,7 @@ void VcardModel::setPostalCode (const QString &postalCode) {
CHECK_VCARD_IS_WRITABLE(this); CHECK_VCARD_IS_WRITABLE(this);
shared_ptr<belcard::BelCardAddress> address = getOrCreateBelCardAddress(mVcard->getVcard()); shared_ptr<belcard::BelCardAddress> address = getOrCreateBelCardAddress(mVcard->getVcard());
address->setPostalCode(::Utils::qStringToLinphoneString(postalCode)); address->setPostalCode(::Utils::appStringToCoreString(postalCode));
emit vcardUpdated(); emit vcardUpdated();
} }
...@@ -278,7 +278,7 @@ void VcardModel::setCountry (const QString &country) { ...@@ -278,7 +278,7 @@ void VcardModel::setCountry (const QString &country) {
CHECK_VCARD_IS_WRITABLE(this); CHECK_VCARD_IS_WRITABLE(this);
shared_ptr<belcard::BelCardAddress> address = getOrCreateBelCardAddress(mVcard->getVcard()); shared_ptr<belcard::BelCardAddress> address = getOrCreateBelCardAddress(mVcard->getVcard());
address->setCountry(::Utils::qStringToLinphoneString(country)); address->setCountry(::Utils::appStringToCoreString(country));
emit vcardUpdated(); emit vcardUpdated();
} }
...@@ -379,7 +379,7 @@ bool VcardModel::addCompany (const QString &company) { ...@@ -379,7 +379,7 @@ bool VcardModel::addCompany (const QString &company) {
return false; return false;
shared_ptr<belcard::BelCardRole> value = belcard::BelCardGeneric::create<belcard::BelCardRole>(); shared_ptr<belcard::BelCardRole> value = belcard::BelCardGeneric::create<belcard::BelCardRole>();
value->setValue(::Utils::qStringToLinphoneString(company)); value->setValue(::Utils::appStringToCoreString(company));
if (!belcard->addRole(value)) { if (!belcard->addRole(value)) {
qWarning() << QStringLiteral("Unable to add company on vcard: `%1`.").arg(company); qWarning() << QStringLiteral("Unable to add company on vcard: `%1`.").arg(company);
...@@ -433,7 +433,7 @@ bool VcardModel::addEmail (const QString &email) { ...@@ -433,7 +433,7 @@ bool VcardModel::addEmail (const QString &email) {
return false; return false;
shared_ptr<belcard::BelCardEmail> value = belcard::BelCardGeneric::create<belcard::BelCardEmail>(); shared_ptr<belcard::BelCardEmail> value = belcard::BelCardGeneric::create<belcard::BelCardEmail>();
value->setValue(::Utils::qStringToLinphoneString(email)); value->setValue(::Utils::appStringToCoreString(email));
if (!belcard->addEmail(value)) { if (!belcard->addEmail(value)) {
qWarning() << QStringLiteral("Unable to add email on vcard: `%1`.").arg(email); qWarning() << QStringLiteral("Unable to add email on vcard: `%1`.").arg(email);
...@@ -488,7 +488,7 @@ bool VcardModel::addUrl (const QString &url) { ...@@ -488,7 +488,7 @@ bool VcardModel::addUrl (const QString &url) {
return false; return false;
shared_ptr<belcard::BelCardURL> value = belcard::BelCardGeneric::create<belcard::BelCardURL>(); shared_ptr<belcard::BelCardURL> value = belcard::BelCardGeneric::create<belcard::BelCardURL>();
value->setValue(::Utils::qStringToLinphoneString(url)); value->setValue(::Utils::appStringToCoreString(url));
if (!belcard->addURL(value)) { if (!belcard->addURL(value)) {
qWarning() << QStringLiteral("Unable to add url on vcard: `%1`.").arg(url); qWarning() << QStringLiteral("Unable to add url on vcard: `%1`.").arg(url);
......
...@@ -131,7 +131,7 @@ bool AccountSettingsModel::addOrUpdateProxyConfig ( ...@@ -131,7 +131,7 @@ bool AccountSettingsModel::addOrUpdateProxyConfig (
// Sip address. // Sip address.
{ {
shared_ptr<linphone::Address> address = linphone::Factory::get()->createAddress( shared_ptr<linphone::Address> address = linphone::Factory::get()->createAddress(
::Utils::qStringToLinphoneString(literal) ::Utils::appStringToCoreString(literal)
); );
if (!address) { if (!address) {
qWarning() << QStringLiteral("Unable to create sip address object from: `%1`.").arg(literal); qWarning() << QStringLiteral("Unable to create sip address object from: `%1`.").arg(literal);
...@@ -145,15 +145,15 @@ bool AccountSettingsModel::addOrUpdateProxyConfig ( ...@@ -145,15 +145,15 @@ bool AccountSettingsModel::addOrUpdateProxyConfig (
{ {
QString serverAddress = data["serverAddress"].toString(); QString serverAddress = data["serverAddress"].toString();
if (proxyConfig->setServerAddr(::Utils::qStringToLinphoneString(serverAddress))) { if (proxyConfig->setServerAddr(::Utils::appStringToCoreString(serverAddress))) {
qWarning() << QStringLiteral("Unable to add server address: `%1`.").arg(serverAddress); qWarning() << QStringLiteral("Unable to add server address: `%1`.").arg(serverAddress);
return false; return false;
} }
} }
proxyConfig->setPublishExpires(data["registrationDuration"].toInt()); proxyConfig->setPublishExpires(data["registrationDuration"].toInt());
proxyConfig->setRoute(::Utils::qStringToLinphoneString(data["route"].toString())); proxyConfig->setRoute(::Utils::appStringToCoreString(data["route"].toString()));
proxyConfig->setContactParameters(::Utils::qStringToLinphoneString(data["contactParams"].toString())); proxyConfig->setContactParameters(::Utils::appStringToCoreString(data["contactParams"].toString()));
proxyConfig->setAvpfRrInterval(static_cast<uint8_t>(data["avpfInterval"].toInt())); proxyConfig->setAvpfRrInterval(static_cast<uint8_t>(data["avpfInterval"].toInt()));
proxyConfig->enableRegister(data["registerEnabled"].toBool()); proxyConfig->enableRegister(data["registerEnabled"].toBool());
proxyConfig->enablePublish(data["publishEnabled"].toBool()); proxyConfig->enablePublish(data["publishEnabled"].toBool());
...@@ -174,8 +174,8 @@ void AccountSettingsModel::addAuthInfo ( ...@@ -174,8 +174,8 @@ void AccountSettingsModel::addAuthInfo (
const QString &password, const QString &password,
const QString &userId const QString &userId
) { ) {
authInfo->setPasswd(::Utils::qStringToLinphoneString(password)); authInfo->setPasswd(::Utils::appStringToCoreString(password));
authInfo->setUserid(::Utils::qStringToLinphoneString(userId)); authInfo->setUserid(::Utils::appStringToCoreString(userId));
CoreManager::getInstance()->getCore()->addAuthInfo(authInfo); CoreManager::getInstance()->getCore()->addAuthInfo(authInfo);
} }
...@@ -199,7 +199,7 @@ void AccountSettingsModel::setUsername (const QString &username) { ...@@ -199,7 +199,7 @@ void AccountSettingsModel::setUsername (const QString &username) {
shared_ptr<const linphone::Address> address = getUsedSipAddress(); shared_ptr<const linphone::Address> address = getUsedSipAddress();
shared_ptr<linphone::Address> newAddress = address->clone(); shared_ptr<linphone::Address> newAddress = address->clone();
if (newAddress->setDisplayName(::Utils::qStringToLinphoneString(username))) { if (newAddress->setDisplayName(::Utils::appStringToCoreString(username))) {
qWarning() << QStringLiteral("Unable to set displayName on sip address: `%1`.") qWarning() << QStringLiteral("Unable to set displayName on sip address: `%1`.")
.arg(::Utils::coreStringToAppString(newAddress->asStringUriOnly())); .arg(::Utils::coreStringToAppString(newAddress->asStringUriOnly()));
} else { } else {
...@@ -231,7 +231,7 @@ void AccountSettingsModel::setPrimaryUsername (const QString &username) { ...@@ -231,7 +231,7 @@ void AccountSettingsModel::setPrimaryUsername (const QString &username) {
shared_ptr<linphone::Address> primary = core->getPrimaryContactParsed(); shared_ptr<linphone::Address> primary = core->getPrimaryContactParsed();
primary->setUsername( primary->setUsername(
username.isEmpty() ? "linphone" : ::Utils::qStringToLinphoneString(username) username.isEmpty() ? "linphone" : ::Utils::appStringToCoreString(username)
); );
core->setPrimaryContact(primary->asString()); core->setPrimaryContact(primary->asString());
...@@ -248,7 +248,7 @@ void AccountSettingsModel::setPrimaryDisplayName (const QString &displayName) { ...@@ -248,7 +248,7 @@ void AccountSettingsModel::setPrimaryDisplayName (const QString &displayName) {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore(); shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
shared_ptr<linphone::Address> primary = core->getPrimaryContactParsed(); shared_ptr<linphone::Address> primary = core->getPrimaryContactParsed();
primary->setDisplayName(::Utils::qStringToLinphoneString(displayName)); primary->setDisplayName(::Utils::appStringToCoreString(displayName));
core->setPrimaryContact(primary->asString()); core->setPrimaryContact(primary->asString());
emit accountSettingsUpdated(); emit accountSettingsUpdated();
......
...@@ -61,7 +61,7 @@ QString SettingsModel::getCaptureDevice () const { ...@@ -61,7 +61,7 @@ QString SettingsModel::getCaptureDevice () const {
void SettingsModel::setCaptureDevice (const QString &device) { void SettingsModel::setCaptureDevice (const QString &device) {
CoreManager::getInstance()->getCore()->setCaptureDevice( CoreManager::getInstance()->getCore()->setCaptureDevice(
::Utils::qStringToLinphoneString(device) ::Utils::appStringToCoreString(device)
); );
emit captureDeviceChanged(device); emit captureDeviceChanged(device);
} }
...@@ -76,7 +76,7 @@ QString SettingsModel::getPlaybackDevice () const { ...@@ -76,7 +76,7 @@ QString SettingsModel::getPlaybackDevice () const {
void SettingsModel::setPlaybackDevice (const QString &device) { void SettingsModel::setPlaybackDevice (const QString &device) {
CoreManager::getInstance()->getCore()->setPlaybackDevice( CoreManager::getInstance()->getCore()->setPlaybackDevice(
::Utils::qStringToLinphoneString(device) ::Utils::appStringToCoreString(device)
); );
emit playbackDeviceChanged(device); emit playbackDeviceChanged(device);
} }
...@@ -91,7 +91,7 @@ QString SettingsModel::getRingerDevice () const { ...@@ -91,7 +91,7 @@ QString SettingsModel::getRingerDevice () const {
void SettingsModel::setRingerDevice (const QString &device) { void SettingsModel::setRingerDevice (const QString &device) {
CoreManager::getInstance()->getCore()->setRingerDevice( CoreManager::getInstance()->getCore()->setRingerDevice(
::Utils::qStringToLinphoneString(device) ::Utils::appStringToCoreString(device)
); );
emit ringerDeviceChanged(device); emit ringerDeviceChanged(device);
} }
...@@ -106,7 +106,7 @@ void SettingsModel::setRingPath (const QString &path) { ...@@ -106,7 +106,7 @@ void SettingsModel::setRingPath (const QString &path) {
QString cleanedPath = QDir::cleanPath(path); QString cleanedPath = QDir::cleanPath(path);
CoreManager::getInstance()->getCore()->setRing( CoreManager::getInstance()->getCore()->setRing(
::Utils::qStringToLinphoneString(cleanedPath) ::Utils::appStringToCoreString(cleanedPath)
); );
emit ringPathChanged(cleanedPath); emit ringPathChanged(cleanedPath);
...@@ -146,7 +146,7 @@ QString SettingsModel::getVideoDevice () const { ...@@ -146,7 +146,7 @@ QString SettingsModel::getVideoDevice () const {
void SettingsModel::setVideoDevice (const QString &device) { void SettingsModel::setVideoDevice (const QString &device) {
CoreManager::getInstance()->getCore()->setVideoDevice( CoreManager::getInstance()->getCore()->setVideoDevice(
::Utils::qStringToLinphoneString(device) ::Utils::appStringToCoreString(device)
); );
emit videoDeviceChanged(device); emit videoDeviceChanged(device);
} }
...@@ -161,7 +161,7 @@ QString SettingsModel::getVideoPreset () const { ...@@ -161,7 +161,7 @@ QString SettingsModel::getVideoPreset () const {
void SettingsModel::setVideoPreset (const QString &preset) { void SettingsModel::setVideoPreset (const QString &preset) {
CoreManager::getInstance()->getCore()->setVideoPreset( CoreManager::getInstance()->getCore()->setVideoPreset(
::Utils::qStringToLinphoneString(preset) ::Utils::appStringToCoreString(preset)
); );
emit videoPresetChanged(preset); emit videoPresetChanged(preset);
} }
...@@ -243,7 +243,7 @@ QString SettingsModel::getFileTransferUrl () const { ...@@ -243,7 +243,7 @@ QString SettingsModel::getFileTransferUrl () const {
void SettingsModel::setFileTransferUrl (const QString &url) { void SettingsModel::setFileTransferUrl (const QString &url) {
CoreManager::getInstance()->getCore()->setFileTransferServer( CoreManager::getInstance()->getCore()->setFileTransferServer(
::Utils::qStringToLinphoneString(url) ::Utils::appStringToCoreString(url)
); );
emit fileTransferUrlChanged(url); emit fileTransferUrlChanged(url);
} }
...@@ -530,7 +530,7 @@ QString SettingsModel::getStunServer () const { ...@@ -530,7 +530,7 @@ QString SettingsModel::getStunServer () const {
void SettingsModel::setStunServer (const QString &stunServer) { void SettingsModel::setStunServer (const QString &stunServer) {
CoreManager::getInstance()->getCore()->getNatPolicy()->setStunServer( CoreManager::getInstance()->getCore()->getNatPolicy()->setStunServer(
::Utils::qStringToLinphoneString(stunServer) ::Utils::appStringToCoreString(stunServer)
); );
} }
...@@ -544,7 +544,7 @@ QString SettingsModel::getTurnUser () const { ...@@ -544,7 +544,7 @@ QString SettingsModel::getTurnUser () const {
void SettingsModel::setTurnUser (const QString &user) { void SettingsModel::setTurnUser (const QString &user) {
CoreManager::getInstance()->getCore()->getNatPolicy()->setStunServerUsername( CoreManager::getInstance()->getCore()->getNatPolicy()->setStunServerUsername(
::Utils::qStringToLinphoneString(user) ::Utils::appStringToCoreString(user)
); );
emit turnUserChanged(user); emit turnUserChanged(user);
...@@ -569,12 +569,12 @@ void SettingsModel::setTurnPassword (const QString &password) { ...@@ -569,12 +569,12 @@ void SettingsModel::setTurnPassword (const QString &password) {
if (authInfo) { if (authInfo) {
shared_ptr<linphone::AuthInfo> clonedAuthInfo = authInfo->clone(); shared_ptr<linphone::AuthInfo> clonedAuthInfo = authInfo->clone();
clonedAuthInfo->setPasswd(::Utils::qStringToLinphoneString(password)); clonedAuthInfo->setPasswd(::Utils::appStringToCoreString(password));
core->removeAuthInfo(authInfo); core->removeAuthInfo(authInfo);
core->addAuthInfo(clonedAuthInfo); core->addAuthInfo(clonedAuthInfo);
} else { } else {
authInfo = linphone::Factory::get()->createAuthInfo(username, username, ::Utils::qStringToLinphoneString(password), "", "", ""); authInfo = linphone::Factory::get()->createAuthInfo(username, username, ::Utils::appStringToCoreString(password), "", "", "");
core->addAuthInfo(authInfo); core->addAuthInfo(authInfo);
} }
...@@ -625,7 +625,7 @@ QString SettingsModel::getSavedScreenshotsFolder () const { ...@@ -625,7 +625,7 @@ QString SettingsModel::getSavedScreenshotsFolder () const {
void SettingsModel::setSavedScreenshotsFolder (const QString &folder) { void SettingsModel::setSavedScreenshotsFolder (const QString &folder) {
QString cleanedFolder = QDir::cleanPath(folder) + QDir::separator(); QString cleanedFolder = QDir::cleanPath(folder) + QDir::separator();
mConfig->setString(UI_SECTION, "saved_screenshots_folder", ::Utils::qStringToLinphoneString(cleanedFolder)); mConfig->setString(UI_SECTION, "saved_screenshots_folder", ::Utils::appStringToCoreString(cleanedFolder));
emit savedScreenshotsFolderChanged(cleanedFolder); emit savedScreenshotsFolderChanged(cleanedFolder);
} }
...@@ -642,7 +642,7 @@ QString SettingsModel::getSavedVideosFolder () const { ...@@ -642,7 +642,7 @@ QString SettingsModel::getSavedVideosFolder () const {
void SettingsModel::setSavedVideosFolder (const QString &folder) { void SettingsModel::setSavedVideosFolder (const QString &folder) {
QString _folder = QDir::cleanPath(folder) + QDir::separator(); QString _folder = QDir::cleanPath(folder) + QDir::separator();
mConfig->setString(UI_SECTION, "saved_videos_folder", ::Utils::qStringToLinphoneString(_folder)); mConfig->setString(UI_SECTION, "saved_videos_folder", ::Utils::appStringToCoreString(_folder));
emit savedVideosFolderChanged(_folder); emit savedVideosFolderChanged(_folder);
} }
...@@ -653,7 +653,7 @@ QString SettingsModel::getRemoteProvisioning () const { ...@@ -653,7 +653,7 @@ QString SettingsModel::getRemoteProvisioning () const {
} }
void SettingsModel::setRemoteProvisioning (const QString &remoteProvisioning) { void SettingsModel::setRemoteProvisioning (const QString &remoteProvisioning) {
if (!CoreManager::getInstance()->getCore()->setProvisioningUri(::Utils::qStringToLinphoneString(remoteProvisioning))) if (!CoreManager::getInstance()->getCore()->setProvisioningUri(::Utils::appStringToCoreString(remoteProvisioning)))
emit remoteProvisioningChanged(remoteProvisioning); emit remoteProvisioningChanged(remoteProvisioning);
else else
emit remoteProvisioningNotChanged(remoteProvisioning); emit remoteProvisioningNotChanged(remoteProvisioning);
......
...@@ -142,7 +142,7 @@ SipAddressObserver *SipAddressesModel::getSipAddressObserver (const QString &sip ...@@ -142,7 +142,7 @@ SipAddressObserver *SipAddressesModel::getSipAddressObserver (const QString &sip
QString SipAddressesModel::interpretUrl (const QString &sipAddress) const { QString SipAddressesModel::interpretUrl (const QString &sipAddress) const {
shared_ptr<linphone::Address> lAddress = CoreManager::getInstance()->getCore()->interpretUrl( shared_ptr<linphone::Address> lAddress = CoreManager::getInstance()->getCore()->interpretUrl(
::Utils::qStringToLinphoneString(sipAddress) ::Utils::appStringToCoreString(sipAddress)
); );
return lAddress ? ::Utils::coreStringToAppString(lAddress->asStringUriOnly()) : ""; return lAddress ? ::Utils::coreStringToAppString(lAddress->asStringUriOnly()) : "";
...@@ -150,7 +150,7 @@ QString SipAddressesModel::interpretUrl (const QString &sipAddress) const { ...@@ -150,7 +150,7 @@ QString SipAddressesModel::interpretUrl (const QString &sipAddress) const {
QString SipAddressesModel::getTransportFromSipAddress (const QString &sipAddress) const { QString SipAddressesModel::getTransportFromSipAddress (const QString &sipAddress) const {
const shared_ptr<const linphone::Address> address = linphone::Factory::get()->createAddress( const shared_ptr<const linphone::Address> address = linphone::Factory::get()->createAddress(
::Utils::qStringToLinphoneString(sipAddress) ::Utils::appStringToCoreString(sipAddress)
); );
if (!address) if (!address)
...@@ -172,7 +172,7 @@ QString SipAddressesModel::getTransportFromSipAddress (const QString &sipAddress ...@@ -172,7 +172,7 @@ QString SipAddressesModel::getTransportFromSipAddress (const QString &sipAddress
QString SipAddressesModel::addTransportToSipAddress (const QString &sipAddress, const QString &transport) const { QString SipAddressesModel::addTransportToSipAddress (const QString &sipAddress, const QString &transport) const {
shared_ptr<linphone::Address> address = linphone::Factory::get()->createAddress( shared_ptr<linphone::Address> address = linphone::Factory::get()->createAddress(
::Utils::qStringToLinphoneString(sipAddress) ::Utils::appStringToCoreString(sipAddress)
); );
if (!address) if (!address)
...@@ -193,7 +193,7 @@ QString SipAddressesModel::addTransportToSipAddress (const QString &sipAddress, ...@@ -193,7 +193,7 @@ QString SipAddressesModel::addTransportToSipAddress (const QString &sipAddress,
bool SipAddressesModel::sipAddressIsValid (const QString &sipAddress) { bool SipAddressesModel::sipAddressIsValid (const QString &sipAddress) {
return !!linphone::Factory::get()->createAddress( return !!linphone::Factory::get()->createAddress(
::Utils::qStringToLinphoneString(sipAddress) ::Utils::appStringToCoreString(sipAddress)
); );
} }
......
...@@ -97,7 +97,7 @@ void SoundPlayer::play () { ...@@ -97,7 +97,7 @@ void SoundPlayer::play () {
if ( if (
(mPlaybackState == SoundPlayer::StoppedState || mPlaybackState == SoundPlayer::ErrorState) && (mPlaybackState == SoundPlayer::StoppedState || mPlaybackState == SoundPlayer::ErrorState) &&
mInternalPlayer->open(::Utils::qStringToLinphoneString(mSource)) mInternalPlayer->open(::Utils::appStringToCoreString(mSource))
) { ) {
qWarning() << QStringLiteral("Unable to open: `%1`").arg(mSource); qWarning() << QStringLiteral("Unable to open: `%1`").arg(mSource);
return; return;
......
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