Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
a346aedd
Commit
a346aedd
authored
May 30, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(app): replace `qStringToLinphoneString` to `appStringToCoreString`
parent
0eaa2521
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
62 additions
and
75 deletions
+62
-75
Utils.hpp
linphone-desktop/src/Utils.hpp
+1
-14
App.cpp
linphone-desktop/src/app/App.cpp
+1
-1
Paths.cpp
linphone-desktop/src/app/paths/Paths.cpp
+2
-2
AssistantModel.cpp
linphone-desktop/src/components/assistant/AssistantModel.cpp
+5
-5
CallModel.cpp
linphone-desktop/src/components/call/CallModel.cpp
+3
-3
CallsListModel.cpp
linphone-desktop/src/components/calls/CallsListModel.cpp
+2
-2
ChatModel.cpp
linphone-desktop/src/components/chat/ChatModel.cpp
+6
-6
AbstractCodecsModel.cpp
...one-desktop/src/components/codecs/AbstractCodecsModel.cpp
+1
-1
ConferenceAddModel.cpp
...-desktop/src/components/conference/ConferenceAddModel.cpp
+1
-1
ConferenceModel.cpp
...one-desktop/src/components/conference/ConferenceModel.cpp
+1
-1
VcardModel.cpp
linphone-desktop/src/components/contact/VcardModel.cpp
+11
-11
AccountSettingsModel.cpp
...-desktop/src/components/settings/AccountSettingsModel.cpp
+9
-9
SettingsModel.cpp
linphone-desktop/src/components/settings/SettingsModel.cpp
+14
-14
SipAddressesModel.cpp
...esktop/src/components/sip-addresses/SipAddressesModel.cpp
+4
-4
SoundPlayer.cpp
linphone-desktop/src/components/sound-player/SoundPlayer.cpp
+1
-1
No files found.
linphone-desktop/src/Utils.hpp
View file @
a346aedd
...
...
@@ -33,23 +33,10 @@ namespace Utils {
return
QString
::
fromLocal8Bit
(
string
.
c_str
(),
static_cast
<
int
>
(
string
.
size
()));
}
inline
std
::
string
qStringToLinphon
eString
(
const
QString
&
string
)
{
inline
std
::
string
appStringToCor
eString
(
const
QString
&
string
)
{
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.
char
*
rstrstr
(
const
char
*
a
,
const
char
*
b
);
}
...
...
linphone-desktop/src/app/App.cpp
View file @
a346aedd
...
...
@@ -444,7 +444,7 @@ QString App::getConfigLocale () const {
void
App
::
setConfigLocale
(
const
QString
&
locale
)
{
CoreManager
::
getInstance
()
->
getCore
()
->
getConfig
()
->
setString
(
SettingsModel
::
UI_SECTION
,
"locale"
,
::
Utils
::
qStringToLinphon
eString
(
locale
)
SettingsModel
::
UI_SECTION
,
"locale"
,
::
Utils
::
appStringToCor
eString
(
locale
)
);
emit
configLocaleChanged
(
locale
);
...
...
linphone-desktop/src/app/paths/Paths.cpp
View file @
a346aedd
...
...
@@ -80,7 +80,7 @@ inline void ensureFilePathExists (const QString &path) {
}
inline
string
getReadableDirPath
(
const
QString
&
dirname
)
{
return
Utils
::
qStringToLinphon
eString
(
QDir
::
toNativeSeparators
(
dirname
));
return
Utils
::
appStringToCor
eString
(
QDir
::
toNativeSeparators
(
dirname
));
}
inline
string
getWritableDirPath
(
const
QString
&
dirname
)
{
...
...
@@ -89,7 +89,7 @@ inline string getWritableDirPath (const QString &dirname) {
}
inline
string
getReadableFilePath
(
const
QString
&
filename
)
{
return
Utils
::
qStringToLinphon
eString
(
QDir
::
toNativeSeparators
(
filename
));
return
Utils
::
appStringToCor
eString
(
QDir
::
toNativeSeparators
(
filename
));
}
inline
string
getWritableFilePath
(
const
QString
&
filename
)
{
...
...
linphone-desktop/src/components/assistant/AssistantModel.cpp
View file @
a346aedd
...
...
@@ -198,7 +198,7 @@ void AssistantModel::setEmail (const QString &email) {
shared_ptr
<
linphone
::
Config
>
config
=
CoreManager
::
getInstance
()
->
getCore
()
->
getConfig
();
QString
error
;
switch
(
mAccountCreator
->
setEmail
(
::
Utils
::
qStringToLinphon
eString
(
email
)))
{
switch
(
mAccountCreator
->
setEmail
(
::
Utils
::
appStringToCor
eString
(
email
)))
{
case
linphone
:
:
AccountCreatorEmailStatusOk
:
break
;
case
linphone
:
:
AccountCreatorEmailStatusMalformed
:
...
...
@@ -222,7 +222,7 @@ void AssistantModel::setPassword (const QString &password) {
shared_ptr
<
linphone
::
Config
>
config
=
CoreManager
::
getInstance
()
->
getCore
()
->
getConfig
();
QString
error
;
switch
(
mAccountCreator
->
setPassword
(
::
Utils
::
qStringToLinphon
eString
(
password
)))
{
switch
(
mAccountCreator
->
setPassword
(
::
Utils
::
appStringToCor
eString
(
password
)))
{
case
linphone
:
:
AccountCreatorPasswordStatusOk
:
break
;
case
linphone
:
:
AccountCreatorPasswordStatusTooShort
:
...
...
@@ -269,7 +269,7 @@ void AssistantModel::setUsername (const QString &username) {
emit
usernameChanged
(
username
,
mapAccountCreatorUsernameStatusToString
(
mAccountCreator
->
setUsername
(
::
Utils
::
qStringToLinphon
eString
(
username
))
mAccountCreator
->
setUsername
(
::
Utils
::
appStringToCor
eString
(
username
))
)
);
}
...
...
@@ -284,7 +284,7 @@ void AssistantModel::setDisplayName (const QString &displayName) {
emit
displayNameChanged
(
displayName
,
mapAccountCreatorUsernameStatusToString
(
mAccountCreator
->
setDisplayName
(
::
Utils
::
qStringToLinphon
eString
(
displayName
))
mAccountCreator
->
setDisplayName
(
::
Utils
::
appStringToCor
eString
(
displayName
))
)
);
}
...
...
@@ -302,7 +302,7 @@ void AssistantModel::setConfigFilename (const QString &configFilename) {
qInfo
()
<<
QStringLiteral
(
"Set config on assistant: `%1`."
).
arg
(
configPath
);
CoreManager
::
getInstance
()
->
getCore
()
->
getConfig
()
->
loadFromXmlFile
(
::
Utils
::
qStringToLinphon
eString
(
configPath
)
::
Utils
::
appStringToCor
eString
(
configPath
)
);
emit
configFilenameChanged
(
configFilename
);
...
...
linphone-desktop/src/components/call/CallModel.cpp
View file @
a346aedd
...
...
@@ -78,7 +78,7 @@ QString CallModel::getSipAddress () const {
void
CallModel
::
setRecordFile
(
shared_ptr
<
linphone
::
CallParams
>
&
callParams
)
{
callParams
->
setRecordFile
(
::
Utils
::
qStringToLinphon
eString
(
::
Utils
::
appStringToCor
eString
(
QStringLiteral
(
"%1%2.mkv"
)
.
arg
(
CoreManager
::
getInstance
()
->
getSettingsModel
()
->
getSavedVideosFolder
())
.
arg
(
QDateTime
::
currentDateTime
().
toString
(
"yyyy-MM-dd_hh:mm:ss"
))
...
...
@@ -142,7 +142,7 @@ void CallModel::askForTransfer () {
}
bool
CallModel
::
transferTo
(
const
QString
&
sipAddress
)
{
bool
status
=
!!
mCall
->
transfer
(
::
Utils
::
qStringToLinphon
eString
(
sipAddress
));
bool
status
=
!!
mCall
->
transfer
(
::
Utils
::
appStringToCor
eString
(
sipAddress
));
if
(
status
)
qWarning
()
<<
QStringLiteral
(
"Unable to transfer: `%1`."
).
arg
(
sipAddress
);
return
status
;
...
...
@@ -176,7 +176,7 @@ void CallModel::takeSnapshot () {
qInfo
()
<<
QStringLiteral
(
"Take snapshot of call:"
)
<<
this
;
mCall
->
takeVideoSnapshot
(
::
Utils
::
qStringToLinphon
eString
(
::
Utils
::
appStringToCor
eString
(
CoreManager
::
getInstance
()
->
getSettingsModel
()
->
getSavedScreenshotsFolder
()
+
newName
)
);
...
...
linphone-desktop/src/components/calls/CallsListModel.cpp
View file @
a346aedd
...
...
@@ -93,7 +93,7 @@ void CallsListModel::askForTransfer (CallModel *callModel) {
void
CallsListModel
::
launchAudioCall
(
const
QString
&
sipUri
)
const
{
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
shared_ptr
<
linphone
::
Address
>
address
=
core
->
interpretUrl
(
::
Utils
::
qStringToLinphon
eString
(
sipUri
));
shared_ptr
<
linphone
::
Address
>
address
=
core
->
interpretUrl
(
::
Utils
::
appStringToCor
eString
(
sipUri
));
if
(
!
address
)
return
;
...
...
@@ -107,7 +107,7 @@ void CallsListModel::launchAudioCall (const QString &sipUri) const {
void
CallsListModel
::
launchVideoCall
(
const
QString
&
sipUri
)
const
{
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
shared_ptr
<
linphone
::
Address
>
address
=
core
->
interpretUrl
(
::
Utils
::
qStringToLinphon
eString
(
sipUri
));
shared_ptr
<
linphone
::
Address
>
address
=
core
->
interpretUrl
(
::
Utils
::
appStringToCor
eString
(
sipUri
));
if
(
!
address
)
return
;
...
...
linphone-desktop/src/components/chat/ChatModel.cpp
View file @
a346aedd
...
...
@@ -78,7 +78,7 @@ inline void createThumbnail (const shared_ptr<linphone::ChatMessage> &message) {
return
;
}
message
->
setAppdata
(
::
Utils
::
qStringToLinphon
eString
(
fileId
));
message
->
setAppdata
(
::
Utils
::
appStringToCor
eString
(
fileId
));
}
inline
void
removeFileMessageThumbnail
(
const
shared_ptr
<
linphone
::
ChatMessage
>
&
message
)
{
...
...
@@ -259,7 +259,7 @@ void ChatModel::setSipAddress (const QString &sipAddress) {
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
mChatRoom
=
core
->
getChatRoomFromUri
(
::
Utils
::
qStringToLinphon
eString
(
sipAddress
));
mChatRoom
=
core
->
getChatRoomFromUri
(
::
Utils
::
appStringToCor
eString
(
sipAddress
));
if
(
mChatRoom
->
getUnreadMessagesCount
()
>
0
)
resetMessagesCount
();
...
...
@@ -316,7 +316,7 @@ void ChatModel::sendMessage (const QString &message) {
if
(
!
mChatRoom
)
return
;
shared_ptr
<
linphone
::
ChatMessage
>
_message
=
mChatRoom
->
createMessage
(
::
Utils
::
qStringToLinphon
eString
(
message
));
shared_ptr
<
linphone
::
ChatMessage
>
_message
=
mChatRoom
->
createMessage
(
::
Utils
::
appStringToCor
eString
(
message
));
_message
->
setListener
(
mMessageHandlers
);
insertMessageAtEnd
(
_message
);
...
...
@@ -376,10 +376,10 @@ void ChatModel::sendFileMessage (const QString &path) {
content
->
setSubtype
(
"octet-stream"
);
content
->
setSize
(
static_cast
<
size_t
>
(
fileSize
));
content
->
setName
(
::
Utils
::
qStringToLinphon
eString
(
QFileInfo
(
file
).
fileName
()));
content
->
setName
(
::
Utils
::
appStringToCor
eString
(
QFileInfo
(
file
).
fileName
()));
shared_ptr
<
linphone
::
ChatMessage
>
message
=
mChatRoom
->
createFileTransferMessage
(
content
);
message
->
setFileTransferFilepath
(
::
Utils
::
qStringToLinphon
eString
(
path
));
message
->
setFileTransferFilepath
(
::
Utils
::
appStringToCor
eString
(
path
));
message
->
setListener
(
mMessageHandlers
);
createThumbnail
(
message
);
...
...
@@ -423,7 +423,7 @@ void ChatModel::downloadFile (int id, const QString &downloadPath) {
return
;
}
message
->
setFileTransferFilepath
(
::
Utils
::
qStringToLinphon
eString
(
downloadPath
));
message
->
setFileTransferFilepath
(
::
Utils
::
appStringToCor
eString
(
downloadPath
));
message
->
setListener
(
mMessageHandlers
);
if
(
message
->
downloadFile
()
<
0
)
...
...
linphone-desktop/src/components/codecs/AbstractCodecsModel.cpp
View file @
a346aedd
...
...
@@ -95,7 +95,7 @@ void AbstractCodecsModel::setRecvFmtp (int id, const QString &recvFmtp) {
QVariantMap
&
map
=
mCodecs
[
id
];
shared_ptr
<
linphone
::
PayloadType
>
codec
=
getCodecFromMap
(
map
);
codec
->
setRecvFmtp
(
::
Utils
::
qStringToLinphon
eString
(
recvFmtp
));
codec
->
setRecvFmtp
(
::
Utils
::
appStringToCor
eString
(
recvFmtp
));
map
[
"recvFmtp"
]
=
::
Utils
::
coreStringToAppString
(
codec
->
getRecvFmtp
());
emit
dataChanged
(
index
(
id
,
0
),
index
(
id
,
0
));
...
...
linphone-desktop/src/components/conference/ConferenceAddModel.cpp
View file @
a346aedd
...
...
@@ -96,7 +96,7 @@ bool ConferenceHelperModel::ConferenceAddModel::addToConference (const QString &
qInfo
()
<<
QStringLiteral
(
"Add sip address to conference: `%1`."
).
arg
(
sipAddress
);
shared_ptr
<
linphone
::
Address
>
linphoneAddress
=
CoreManager
::
getInstance
()
->
getCore
()
->
interpretUrl
(
::
Utils
::
qStringToLinphon
eString
(
sipAddress
)
::
Utils
::
appStringToCor
eString
(
sipAddress
)
);
addToConferencePrivate
(
linphoneAddress
);
...
...
linphone-desktop/src/components/conference/ConferenceModel.cpp
View file @
a346aedd
...
...
@@ -71,7 +71,7 @@ void ConferenceModel::startRecording () {
CoreManager
*
coreManager
=
CoreManager
::
getInstance
();
coreManager
->
getCore
()
->
startConferenceRecording
(
::
Utils
::
qStringToLinphon
eString
(
::
Utils
::
appStringToCor
eString
(
QStringLiteral
(
"%1%2.mkv"
)
.
arg
(
coreManager
->
getSettingsModel
()
->
getSavedVideosFolder
())
.
arg
(
QDateTime
::
currentDateTime
().
toString
(
"yyyy-MM-dd_hh:mm:ss"
))
...
...
linphone-desktop/src/components/contact/VcardModel.cpp
View file @
a346aedd
...
...
@@ -55,7 +55,7 @@ inline shared_ptr<T> findBelCardValue (const list<shared_ptr<T> > &list, const s
template
<
class
T
>
inline
shared_ptr
<
T
>
findBelCardValue
(
const
list
<
shared_ptr
<
T
>
>
&
list
,
const
QString
&
value
)
{
return
findBelCardValue
(
list
,
::
Utils
::
qStringToLinphon
eString
(
value
));
return
findBelCardValue
(
list
,
::
Utils
::
appStringToCor
eString
(
value
));
}
inline
bool
isLinphoneDesktopPhoto
(
const
shared_ptr
<
belcard
::
BelCardPhoto
>
&
photo
)
{
...
...
@@ -100,7 +100,7 @@ static string interpretSipAddress (const QString &sipAddress) {
string
out
;
shared_ptr
<
linphone
::
Address
>
linphoneAddress
=
CoreManager
::
getInstance
()
->
getCore
()
->
interpretUrl
(
::
Utils
::
qStringToLinphon
eString
(
sipAddress
)
::
Utils
::
appStringToCor
eString
(
sipAddress
)
);
if
(
!
linphoneAddress
)
{
...
...
@@ -189,7 +189,7 @@ bool VcardModel::setAvatar (const QString &path) {
// 3. Update new photo.
if
(
!
path
.
isEmpty
())
{
shared_ptr
<
belcard
::
BelCardPhoto
>
photo
=
belcard
::
BelCardGeneric
::
create
<
belcard
::
BelCardPhoto
>
();
photo
->
setValue
(
VCARD_SCHEME
+
::
Utils
::
qStringToLinphon
eString
(
fileId
));
photo
->
setValue
(
VCARD_SCHEME
+
::
Utils
::
appStringToCor
eString
(
fileId
));
if
(
!
belcard
->
addPhoto
(
photo
))
{
file
.
remove
();
...
...
@@ -214,7 +214,7 @@ void VcardModel::setUsername (const QString &username) {
if
(
username
.
length
()
==
0
||
username
==
getUsername
())
return
;
mVcard
->
setFullName
(
::
Utils
::
qStringToLinphon
eString
(
username
));
mVcard
->
setFullName
(
::
Utils
::
appStringToCor
eString
(
username
));
emit
vcardUpdated
();
}
...
...
@@ -254,7 +254,7 @@ void VcardModel::setStreet (const QString &street) {
CHECK_VCARD_IS_WRITABLE
(
this
);
shared_ptr
<
belcard
::
BelCardAddress
>
address
=
getOrCreateBelCardAddress
(
mVcard
->
getVcard
());
address
->
setStreet
(
::
Utils
::
qStringToLinphon
eString
(
street
));
address
->
setStreet
(
::
Utils
::
appStringToCor
eString
(
street
));
emit
vcardUpdated
();
}
...
...
@@ -262,7 +262,7 @@ void VcardModel::setLocality (const QString &locality) {
CHECK_VCARD_IS_WRITABLE
(
this
);
shared_ptr
<
belcard
::
BelCardAddress
>
address
=
getOrCreateBelCardAddress
(
mVcard
->
getVcard
());
address
->
setLocality
(
::
Utils
::
qStringToLinphon
eString
(
locality
));
address
->
setLocality
(
::
Utils
::
appStringToCor
eString
(
locality
));
emit
vcardUpdated
();
}
...
...
@@ -270,7 +270,7 @@ void VcardModel::setPostalCode (const QString &postalCode) {
CHECK_VCARD_IS_WRITABLE
(
this
);
shared_ptr
<
belcard
::
BelCardAddress
>
address
=
getOrCreateBelCardAddress
(
mVcard
->
getVcard
());
address
->
setPostalCode
(
::
Utils
::
qStringToLinphon
eString
(
postalCode
));
address
->
setPostalCode
(
::
Utils
::
appStringToCor
eString
(
postalCode
));
emit
vcardUpdated
();
}
...
...
@@ -278,7 +278,7 @@ void VcardModel::setCountry (const QString &country) {
CHECK_VCARD_IS_WRITABLE
(
this
);
shared_ptr
<
belcard
::
BelCardAddress
>
address
=
getOrCreateBelCardAddress
(
mVcard
->
getVcard
());
address
->
setCountry
(
::
Utils
::
qStringToLinphon
eString
(
country
));
address
->
setCountry
(
::
Utils
::
appStringToCor
eString
(
country
));
emit
vcardUpdated
();
}
...
...
@@ -379,7 +379,7 @@ bool VcardModel::addCompany (const QString &company) {
return
false
;
shared_ptr
<
belcard
::
BelCardRole
>
value
=
belcard
::
BelCardGeneric
::
create
<
belcard
::
BelCardRole
>
();
value
->
setValue
(
::
Utils
::
qStringToLinphon
eString
(
company
));
value
->
setValue
(
::
Utils
::
appStringToCor
eString
(
company
));
if
(
!
belcard
->
addRole
(
value
))
{
qWarning
()
<<
QStringLiteral
(
"Unable to add company on vcard: `%1`."
).
arg
(
company
);
...
...
@@ -433,7 +433,7 @@ bool VcardModel::addEmail (const QString &email) {
return
false
;
shared_ptr
<
belcard
::
BelCardEmail
>
value
=
belcard
::
BelCardGeneric
::
create
<
belcard
::
BelCardEmail
>
();
value
->
setValue
(
::
Utils
::
qStringToLinphon
eString
(
email
));
value
->
setValue
(
::
Utils
::
appStringToCor
eString
(
email
));
if
(
!
belcard
->
addEmail
(
value
))
{
qWarning
()
<<
QStringLiteral
(
"Unable to add email on vcard: `%1`."
).
arg
(
email
);
...
...
@@ -488,7 +488,7 @@ bool VcardModel::addUrl (const QString &url) {
return
false
;
shared_ptr
<
belcard
::
BelCardURL
>
value
=
belcard
::
BelCardGeneric
::
create
<
belcard
::
BelCardURL
>
();
value
->
setValue
(
::
Utils
::
qStringToLinphon
eString
(
url
));
value
->
setValue
(
::
Utils
::
appStringToCor
eString
(
url
));
if
(
!
belcard
->
addURL
(
value
))
{
qWarning
()
<<
QStringLiteral
(
"Unable to add url on vcard: `%1`."
).
arg
(
url
);
...
...
linphone-desktop/src/components/settings/AccountSettingsModel.cpp
View file @
a346aedd
...
...
@@ -131,7 +131,7 @@ bool AccountSettingsModel::addOrUpdateProxyConfig (
// Sip address.
{
shared_ptr
<
linphone
::
Address
>
address
=
linphone
::
Factory
::
get
()
->
createAddress
(
::
Utils
::
qStringToLinphon
eString
(
literal
)
::
Utils
::
appStringToCor
eString
(
literal
)
);
if
(
!
address
)
{
qWarning
()
<<
QStringLiteral
(
"Unable to create sip address object from: `%1`."
).
arg
(
literal
);
...
...
@@ -145,15 +145,15 @@ bool AccountSettingsModel::addOrUpdateProxyConfig (
{
QString
serverAddress
=
data
[
"serverAddress"
].
toString
();
if
(
proxyConfig
->
setServerAddr
(
::
Utils
::
qStringToLinphon
eString
(
serverAddress
)))
{
if
(
proxyConfig
->
setServerAddr
(
::
Utils
::
appStringToCor
eString
(
serverAddress
)))
{
qWarning
()
<<
QStringLiteral
(
"Unable to add server address: `%1`."
).
arg
(
serverAddress
);
return
false
;
}
}
proxyConfig
->
setPublishExpires
(
data
[
"registrationDuration"
].
toInt
());
proxyConfig
->
setRoute
(
::
Utils
::
qStringToLinphon
eString
(
data
[
"route"
].
toString
()));
proxyConfig
->
setContactParameters
(
::
Utils
::
qStringToLinphon
eString
(
data
[
"contactParams"
].
toString
()));
proxyConfig
->
setRoute
(
::
Utils
::
appStringToCor
eString
(
data
[
"route"
].
toString
()));
proxyConfig
->
setContactParameters
(
::
Utils
::
appStringToCor
eString
(
data
[
"contactParams"
].
toString
()));
proxyConfig
->
setAvpfRrInterval
(
static_cast
<
uint8_t
>
(
data
[
"avpfInterval"
].
toInt
()));
proxyConfig
->
enableRegister
(
data
[
"registerEnabled"
].
toBool
());
proxyConfig
->
enablePublish
(
data
[
"publishEnabled"
].
toBool
());
...
...
@@ -174,8 +174,8 @@ void AccountSettingsModel::addAuthInfo (
const
QString
&
password
,
const
QString
&
userId
)
{
authInfo
->
setPasswd
(
::
Utils
::
qStringToLinphon
eString
(
password
));
authInfo
->
setUserid
(
::
Utils
::
qStringToLinphon
eString
(
userId
));
authInfo
->
setPasswd
(
::
Utils
::
appStringToCor
eString
(
password
));
authInfo
->
setUserid
(
::
Utils
::
appStringToCor
eString
(
userId
));
CoreManager
::
getInstance
()
->
getCore
()
->
addAuthInfo
(
authInfo
);
}
...
...
@@ -199,7 +199,7 @@ void AccountSettingsModel::setUsername (const QString &username) {
shared_ptr
<
const
linphone
::
Address
>
address
=
getUsedSipAddress
();
shared_ptr
<
linphone
::
Address
>
newAddress
=
address
->
clone
();
if
(
newAddress
->
setDisplayName
(
::
Utils
::
qStringToLinphon
eString
(
username
)))
{
if
(
newAddress
->
setDisplayName
(
::
Utils
::
appStringToCor
eString
(
username
)))
{
qWarning
()
<<
QStringLiteral
(
"Unable to set displayName on sip address: `%1`."
)
.
arg
(
::
Utils
::
coreStringToAppString
(
newAddress
->
asStringUriOnly
()));
}
else
{
...
...
@@ -231,7 +231,7 @@ void AccountSettingsModel::setPrimaryUsername (const QString &username) {
shared_ptr
<
linphone
::
Address
>
primary
=
core
->
getPrimaryContactParsed
();
primary
->
setUsername
(
username
.
isEmpty
()
?
"linphone"
:
::
Utils
::
qStringToLinphon
eString
(
username
)
username
.
isEmpty
()
?
"linphone"
:
::
Utils
::
appStringToCor
eString
(
username
)
);
core
->
setPrimaryContact
(
primary
->
asString
());
...
...
@@ -248,7 +248,7 @@ void AccountSettingsModel::setPrimaryDisplayName (const QString &displayName) {
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
shared_ptr
<
linphone
::
Address
>
primary
=
core
->
getPrimaryContactParsed
();
primary
->
setDisplayName
(
::
Utils
::
qStringToLinphon
eString
(
displayName
));
primary
->
setDisplayName
(
::
Utils
::
appStringToCor
eString
(
displayName
));
core
->
setPrimaryContact
(
primary
->
asString
());
emit
accountSettingsUpdated
();
...
...
linphone-desktop/src/components/settings/SettingsModel.cpp
View file @
a346aedd
...
...
@@ -61,7 +61,7 @@ QString SettingsModel::getCaptureDevice () const {
void
SettingsModel
::
setCaptureDevice
(
const
QString
&
device
)
{
CoreManager
::
getInstance
()
->
getCore
()
->
setCaptureDevice
(
::
Utils
::
qStringToLinphon
eString
(
device
)
::
Utils
::
appStringToCor
eString
(
device
)
);
emit
captureDeviceChanged
(
device
);
}
...
...
@@ -76,7 +76,7 @@ QString SettingsModel::getPlaybackDevice () const {
void
SettingsModel
::
setPlaybackDevice
(
const
QString
&
device
)
{
CoreManager
::
getInstance
()
->
getCore
()
->
setPlaybackDevice
(
::
Utils
::
qStringToLinphon
eString
(
device
)
::
Utils
::
appStringToCor
eString
(
device
)
);
emit
playbackDeviceChanged
(
device
);
}
...
...
@@ -91,7 +91,7 @@ QString SettingsModel::getRingerDevice () const {
void
SettingsModel
::
setRingerDevice
(
const
QString
&
device
)
{
CoreManager
::
getInstance
()
->
getCore
()
->
setRingerDevice
(
::
Utils
::
qStringToLinphon
eString
(
device
)
::
Utils
::
appStringToCor
eString
(
device
)
);
emit
ringerDeviceChanged
(
device
);
}
...
...
@@ -106,7 +106,7 @@ void SettingsModel::setRingPath (const QString &path) {
QString
cleanedPath
=
QDir
::
cleanPath
(
path
);
CoreManager
::
getInstance
()
->
getCore
()
->
setRing
(
::
Utils
::
qStringToLinphon
eString
(
cleanedPath
)
::
Utils
::
appStringToCor
eString
(
cleanedPath
)
);
emit
ringPathChanged
(
cleanedPath
);
...
...
@@ -146,7 +146,7 @@ QString SettingsModel::getVideoDevice () const {
void
SettingsModel
::
setVideoDevice
(
const
QString
&
device
)
{
CoreManager
::
getInstance
()
->
getCore
()
->
setVideoDevice
(
::
Utils
::
qStringToLinphon
eString
(
device
)
::
Utils
::
appStringToCor
eString
(
device
)
);
emit
videoDeviceChanged
(
device
);
}
...
...
@@ -161,7 +161,7 @@ QString SettingsModel::getVideoPreset () const {
void
SettingsModel
::
setVideoPreset
(
const
QString
&
preset
)
{
CoreManager
::
getInstance
()
->
getCore
()
->
setVideoPreset
(
::
Utils
::
qStringToLinphon
eString
(
preset
)
::
Utils
::
appStringToCor
eString
(
preset
)
);
emit
videoPresetChanged
(
preset
);
}
...
...
@@ -243,7 +243,7 @@ QString SettingsModel::getFileTransferUrl () const {
void
SettingsModel
::
setFileTransferUrl
(
const
QString
&
url
)
{
CoreManager
::
getInstance
()
->
getCore
()
->
setFileTransferServer
(
::
Utils
::
qStringToLinphon
eString
(
url
)
::
Utils
::
appStringToCor
eString
(
url
)
);
emit
fileTransferUrlChanged
(
url
);
}
...
...
@@ -530,7 +530,7 @@ QString SettingsModel::getStunServer () const {
void
SettingsModel
::
setStunServer
(
const
QString
&
stunServer
)
{
CoreManager
::
getInstance
()
->
getCore
()
->
getNatPolicy
()
->
setStunServer
(
::
Utils
::
qStringToLinphon
eString
(
stunServer
)
::
Utils
::
appStringToCor
eString
(
stunServer
)
);
}
...
...
@@ -544,7 +544,7 @@ QString SettingsModel::getTurnUser () const {
void
SettingsModel
::
setTurnUser
(
const
QString
&
user
)
{
CoreManager
::
getInstance
()
->
getCore
()
->
getNatPolicy
()
->
setStunServerUsername
(
::
Utils
::
qStringToLinphon
eString
(
user
)
::
Utils
::
appStringToCor
eString
(
user
)
);
emit
turnUserChanged
(
user
);
...
...
@@ -569,12 +569,12 @@ void SettingsModel::setTurnPassword (const QString &password) {
if
(
authInfo
)
{
shared_ptr
<
linphone
::
AuthInfo
>
clonedAuthInfo
=
authInfo
->
clone
();
clonedAuthInfo
->
setPasswd
(
::
Utils
::
qStringToLinphon
eString
(
password
));
clonedAuthInfo
->
setPasswd
(
::
Utils
::
appStringToCor
eString
(
password
));
core
->
removeAuthInfo
(
authInfo
);
core
->
addAuthInfo
(
clonedAuthInfo
);
}
else
{
authInfo
=
linphone
::
Factory
::
get
()
->
createAuthInfo
(
username
,
username
,
::
Utils
::
qStringToLinphon
eString
(
password
),
""
,
""
,
""
);
authInfo
=
linphone
::
Factory
::
get
()
->
createAuthInfo
(
username
,
username
,
::
Utils
::
appStringToCor
eString
(
password
),
""
,
""
,
""
);
core
->
addAuthInfo
(
authInfo
);
}
...
...
@@ -625,7 +625,7 @@ QString SettingsModel::getSavedScreenshotsFolder () const {
void
SettingsModel
::
setSavedScreenshotsFolder
(
const
QString
&
folder
)
{
QString
cleanedFolder
=
QDir
::
cleanPath
(
folder
)
+
QDir
::
separator
();
mConfig
->
setString
(
UI_SECTION
,
"saved_screenshots_folder"
,
::
Utils
::
qStringToLinphon
eString
(
cleanedFolder
));
mConfig
->
setString
(
UI_SECTION
,
"saved_screenshots_folder"
,
::
Utils
::
appStringToCor
eString
(
cleanedFolder
));
emit
savedScreenshotsFolderChanged
(
cleanedFolder
);
}
...
...
@@ -642,7 +642,7 @@ QString SettingsModel::getSavedVideosFolder () const {
void
SettingsModel
::
setSavedVideosFolder
(
const
QString
&
folder
)
{
QString
_folder
=
QDir
::
cleanPath
(
folder
)
+
QDir
::
separator
();
mConfig
->
setString
(
UI_SECTION
,
"saved_videos_folder"
,
::
Utils
::
qStringToLinphon
eString
(
_folder
));
mConfig
->
setString
(
UI_SECTION
,
"saved_videos_folder"
,
::
Utils
::
appStringToCor
eString
(
_folder
));
emit
savedVideosFolderChanged
(
_folder
);
}
...
...
@@ -653,7 +653,7 @@ QString SettingsModel::getRemoteProvisioning () const {
}
void
SettingsModel
::
setRemoteProvisioning
(
const
QString
&
remoteProvisioning
)
{
if
(
!
CoreManager
::
getInstance
()
->
getCore
()
->
setProvisioningUri
(
::
Utils
::
qStringToLinphon
eString
(
remoteProvisioning
)))
if
(
!
CoreManager
::
getInstance
()
->
getCore
()
->
setProvisioningUri
(
::
Utils
::
appStringToCor
eString
(
remoteProvisioning
)))
emit
remoteProvisioningChanged
(
remoteProvisioning
);
else
emit
remoteProvisioningNotChanged
(
remoteProvisioning
);
...
...
linphone-desktop/src/components/sip-addresses/SipAddressesModel.cpp
View file @
a346aedd
...
...
@@ -142,7 +142,7 @@ SipAddressObserver *SipAddressesModel::getSipAddressObserver (const QString &sip
QString
SipAddressesModel
::
interpretUrl
(
const
QString
&
sipAddress
)
const
{
shared_ptr
<
linphone
::
Address
>
lAddress
=
CoreManager
::
getInstance
()
->
getCore
()
->
interpretUrl
(
::
Utils
::
qStringToLinphon
eString
(
sipAddress
)
::
Utils
::
appStringToCor
eString
(
sipAddress
)
);
return
lAddress
?
::
Utils
::
coreStringToAppString
(
lAddress
->
asStringUriOnly
())
:
""
;
...
...
@@ -150,7 +150,7 @@ QString SipAddressesModel::interpretUrl (const QString &sipAddress) const {
QString
SipAddressesModel
::
getTransportFromSipAddress
(
const
QString
&
sipAddress
)
const
{
const
shared_ptr
<
const
linphone
::
Address
>
address
=
linphone
::
Factory
::
get
()
->
createAddress
(
::
Utils
::
qStringToLinphon
eString
(
sipAddress
)
::
Utils
::
appStringToCor
eString
(
sipAddress
)
);
if
(
!
address
)
...
...
@@ -172,7 +172,7 @@ QString SipAddressesModel::getTransportFromSipAddress (const QString &sipAddress
QString
SipAddressesModel
::
addTransportToSipAddress
(
const
QString
&
sipAddress
,
const
QString
&
transport
)
const
{
shared_ptr
<
linphone
::
Address
>
address
=
linphone
::
Factory
::
get
()
->
createAddress
(
::
Utils
::
qStringToLinphon
eString
(
sipAddress
)
::
Utils
::
appStringToCor
eString
(
sipAddress
)
);
if
(
!
address
)
...
...
@@ -193,7 +193,7 @@ QString SipAddressesModel::addTransportToSipAddress (const QString &sipAddress,
bool
SipAddressesModel
::
sipAddressIsValid
(
const
QString
&
sipAddress
)
{
return
!!
linphone
::
Factory
::
get
()
->
createAddress
(
::
Utils
::
qStringToLinphon
eString
(
sipAddress
)
::
Utils
::
appStringToCor
eString
(
sipAddress
)
);
}
...
...
linphone-desktop/src/components/sound-player/SoundPlayer.cpp
View file @
a346aedd
...
...
@@ -97,7 +97,7 @@ void SoundPlayer::play () {
if
(
(
mPlaybackState
==
SoundPlayer
::
StoppedState
||
mPlaybackState
==
SoundPlayer
::
ErrorState
)
&&
mInternalPlayer
->
open
(
::
Utils
::
qStringToLinphon
eString
(
mSource
))
mInternalPlayer
->
open
(
::
Utils
::
appStringToCor
eString
(
mSource
))
)
{
qWarning
()
<<
QStringLiteral
(
"Unable to open: `%1`"
).
arg
(
mSource
);
return
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment