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
8bbc2309
Commit
8bbc2309
authored
Jan 24, 2018
by
Danmei Chen
Committed by
Ronan Abhamon
Jan 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
migrate proxy config
parent
9cf08623
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
CoreManager.cpp
src/components/core/CoreManager.cpp
+27
-1
CoreManager.hpp
src/components/core/CoreManager.hpp
+1
-0
No files found.
src/components/core/CoreManager.cpp
View file @
8bbc2309
...
...
@@ -74,7 +74,7 @@ CoreManager::CoreManager (QObject *parent, const QString &configPath) :
mInstance
->
mAccountSettingsModel
=
new
AccountSettingsModel
(
mInstance
);
mInstance
->
mStarted
=
true
;
mInstance
->
migrate
();
emit
mInstance
->
coreStarted
();
});
...
...
@@ -234,6 +234,32 @@ void CoreManager::createLinphoneCore (const QString &configPath) {
setOtherPaths
();
}
#define RC_VERSION_NAME "rc_version"
#define RC_VERSION_CURRENT 1
void
CoreManager
::
migrate
()
{
shared_ptr
<
linphone
::
Config
>
config
=
mCore
->
getConfig
();
int
rcVersion
=
config
->
getInt
(
SettingsModel
::
UI_SECTION
,
RC_VERSION_NAME
,
0
);
if
(
rcVersion
==
RC_VERSION_CURRENT
)
return
;
if
(
rcVersion
>
RC_VERSION_CURRENT
)
{
qWarning
()
<<
"RC file version ("
<<
rcVersion
<<
") is more recent than app rc file version ("
<<
RC_VERSION_CURRENT
<<
")!!!"
;
return
;
}
qInfo
()
<<
"Migrate from old rc file ("
<<
rcVersion
<<
"to"
<<
RC_VERSION_CURRENT
<<
")."
;
// Add message_expires param on old proxy configs.
for
(
const
auto
&
proxyConfig
:
mCore
->
getProxyConfigList
())
{
if
(
proxyConfig
->
getDomain
()
==
"sip.linphone.org"
)
{
proxyConfig
->
setContactParameters
(
"message-expires=604800"
);
proxyConfig
->
setExpires
(
3600
);
proxyConfig
->
done
();
}
}
config
->
setInt
(
SettingsModel
::
UI_SECTION
,
RC_VERSION_NAME
,
RC_VERSION_CURRENT
);
}
// -----------------------------------------------------------------------------
QString
CoreManager
::
getVersion
()
const
{
...
...
src/components/core/CoreManager.hpp
View file @
8bbc2309
...
...
@@ -143,6 +143,7 @@ private:
void
setResourcesPaths
();
void
createLinphoneCore
(
const
QString
&
configPath
);
void
migrate
();
QString
getVersion
()
const
;
...
...
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