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
3af9220a
Commit
3af9220a
authored
Jan 29, 2018
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(CoreManager): use constrexpr instead of define on rc version name / current
parent
0fb44e60
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
CoreManager.cpp
src/components/core/CoreManager.cpp
+9
-9
No files found.
src/components/core/CoreManager.cpp
View file @
3af9220a
...
...
@@ -45,6 +45,9 @@ using namespace std;
namespace
{
constexpr
int
cCbsCallInterval
=
20
;
constexpr
char
cRcVersionName
[]
=
"rc_version"
;
constexpr
int
cRcVersionCurrent
=
1
;
// TODO: Remove hardcoded values. Use config directly.
constexpr
char
cLinphoneDomain
[]
=
"sip.linphone.org"
;
constexpr
char
cDefaultContactParameters
[]
=
"message-expires=604800"
;
...
...
@@ -243,22 +246,19 @@ 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
)
int
rcVersion
=
config
->
getInt
(
SettingsModel
::
UI_SECTION
,
cRcVersionName
,
0
);
if
(
rcVersion
==
cRcVersionCurrent
)
return
;
if
(
rcVersion
>
RC_VERSION_CURRENT
)
{
if
(
rcVersion
>
cRcVersionCurrent
)
{
qWarning
()
<<
QStringLiteral
(
"RC file version (%1) is more recent than app rc file version (%2)!!!"
)
.
arg
(
rcVersion
).
arg
(
RC_VERSION_CURRENT
);
.
arg
(
rcVersion
).
arg
(
cRcVersionCurrent
);
return
;
}
qInfo
()
<<
QStringLiteral
(
"Migrate from old rc file (%1 to %2)."
)
.
arg
(
rcVersion
).
arg
(
RC_VERSION_CURRENT
);
.
arg
(
rcVersion
).
arg
(
cRcVersionCurrent
);
// Add message_expires param on old proxy configs.
for
(
const
auto
&
proxyConfig
:
mCore
->
getProxyConfigList
())
{
...
...
@@ -268,7 +268,7 @@ void CoreManager::migrate () {
proxyConfig
->
done
();
}
}
config
->
setInt
(
SettingsModel
::
UI_SECTION
,
RC_VERSION_NAME
,
RC_VERSION_CURRENT
);
config
->
setInt
(
SettingsModel
::
UI_SECTION
,
cRcVersionName
,
cRcVersionCurrent
);
}
// -----------------------------------------------------------------------------
...
...
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