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
0fb44e60
Commit
0fb44e60
authored
Jan 29, 2018
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(CoreManager): add TODO to remove hardcoded values and use constexpr instead of define
parent
1131bc53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
CoreManager.cpp
src/components/core/CoreManager.cpp
+17
-9
No files found.
src/components/core/CoreManager.cpp
View file @
0fb44e60
...
@@ -38,14 +38,22 @@
...
@@ -38,14 +38,22 @@
#include "CoreManager.hpp"
#include "CoreManager.hpp"
#define CBS_CALL_INTERVAL 20
#define DOWNLOAD_URL "https://www.linphone.org/technical-corner/linphone/downloads"
using
namespace
std
;
using
namespace
std
;
// =============================================================================
// =============================================================================
namespace
{
constexpr
int
cCbsCallInterval
=
20
;
// TODO: Remove hardcoded values. Use config directly.
constexpr
char
cLinphoneDomain
[]
=
"sip.linphone.org"
;
constexpr
char
cDefaultContactParameters
[]
=
"message-expires=604800"
;
constexpr
int
cDefaultExpires
=
3600
;
constexpr
char
cDownloadUrl
[]
=
"https://www.linphone.org/technical-corner/linphone/downloads"
;
}
// -----------------------------------------------------------------------------
CoreManager
*
CoreManager
::
mInstance
=
nullptr
;
CoreManager
*
CoreManager
::
mInstance
=
nullptr
;
CoreManager
::
CoreManager
(
QObject
*
parent
,
const
QString
&
configPath
)
:
CoreManager
::
CoreManager
(
QObject
*
parent
,
const
QString
&
configPath
)
:
...
@@ -125,7 +133,7 @@ void CoreManager::init (QObject *parent, const QString &configPath) {
...
@@ -125,7 +133,7 @@ void CoreManager::init (QObject *parent, const QString &configPath) {
mInstance
=
new
CoreManager
(
parent
,
configPath
);
mInstance
=
new
CoreManager
(
parent
,
configPath
);
QTimer
*
timer
=
mInstance
->
mCbsTimer
=
new
QTimer
(
mInstance
);
QTimer
*
timer
=
mInstance
->
mCbsTimer
=
new
QTimer
(
mInstance
);
timer
->
setInterval
(
CBS_CALL_INTERVAL
);
timer
->
setInterval
(
cCbsCallInterval
);
QObject
::
connect
(
timer
,
&
QTimer
::
timeout
,
mInstance
,
&
CoreManager
::
iterate
);
QObject
::
connect
(
timer
,
&
QTimer
::
timeout
,
mInstance
,
&
CoreManager
::
iterate
);
}
}
...
@@ -254,9 +262,9 @@ void CoreManager::migrate () {
...
@@ -254,9 +262,9 @@ void CoreManager::migrate () {
// Add message_expires param on old proxy configs.
// Add message_expires param on old proxy configs.
for
(
const
auto
&
proxyConfig
:
mCore
->
getProxyConfigList
())
{
for
(
const
auto
&
proxyConfig
:
mCore
->
getProxyConfigList
())
{
if
(
proxyConfig
->
getDomain
()
==
"sip.linphone.org"
)
{
if
(
proxyConfig
->
getDomain
()
==
cLinphoneDomain
)
{
proxyConfig
->
setContactParameters
(
"message-expires=604800"
);
proxyConfig
->
setContactParameters
(
cDefaultContactParameters
);
proxyConfig
->
setExpires
(
3600
);
proxyConfig
->
setExpires
(
cDefaultExpires
);
proxyConfig
->
done
();
proxyConfig
->
done
();
}
}
}
}
...
@@ -294,5 +302,5 @@ void CoreManager::handleLogsUploadStateChanged (linphone::CoreLogCollectionUploa
...
@@ -294,5 +302,5 @@ void CoreManager::handleLogsUploadStateChanged (linphone::CoreLogCollectionUploa
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
QString
CoreManager
::
getDownloadUrl
()
{
QString
CoreManager
::
getDownloadUrl
()
{
return
QStringLiteral
(
DOWNLOAD_URL
)
;
return
cDownloadUrl
;
}
}
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