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