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
3647ed9c
Commit
3647ed9c
authored
May 10, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(src/components/core/CoreManager): schedule global state emit in the app thread
parent
9ee13e18
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
7 deletions
+27
-7
CoreHandlers.cpp
linphone-desktop/src/components/core/CoreHandlers.cpp
+14
-4
CoreManager.cpp
linphone-desktop/src/components/core/CoreManager.cpp
+3
-1
CoreManager.hpp
linphone-desktop/src/components/core/CoreManager.hpp
+9
-1
MainWindow.qml
linphone-desktop/ui/views/App/Main/MainWindow.qml
+1
-1
No files found.
linphone-desktop/src/components/core/CoreHandlers.cpp
View file @
3647ed9c
...
...
@@ -21,6 +21,7 @@
*/
#include <QtDebug>
#include <QTimer>
#include "../../app/App.hpp"
#include "../../Utils.hpp"
...
...
@@ -32,6 +33,10 @@ using namespace std;
// =============================================================================
inline
void
logGlobalState
(
linphone
::
GlobalState
gstate
)
{
qInfo
()
<<
QStringLiteral
(
"Global state: %1."
).
arg
(
gstate
);
}
void
CoreHandlers
::
onAuthenticationRequested
(
const
shared_ptr
<
linphone
::
Core
>
&
,
const
shared_ptr
<
linphone
::
AuthInfo
>
&
authInfo
,
...
...
@@ -57,10 +62,15 @@ void CoreHandlers::onGlobalStateChanged (
linphone
::
GlobalState
gstate
,
const
string
&
)
{
qInfo
()
<<
QStringLiteral
(
"Global state: %1."
).
arg
(
gstate
);
if
(
gstate
==
linphone
::
GlobalStateOn
)
emit
coreStarted
();
if
(
gstate
==
linphone
::
GlobalStateOn
)
{
QTimer
::
singleShot
(
0
,
App
::
getInstance
(),
[
this
,
gstate
]()
{
logGlobalState
(
gstate
);
emit
coreStarted
();
}
);
}
else
logGlobalState
(
gstate
);
}
void
CoreHandlers
::
onCallStatsUpdated
(
...
...
linphone-desktop/src/components/core/CoreManager.cpp
View file @
3647ed9c
...
...
@@ -51,7 +51,7 @@ CoreManager::CoreManager (QObject *parent, const QString &configPath) : QObject(
qInfo
()
<<
QStringLiteral
(
"Core created. Enable iterate."
);
mInstance
->
mCbsTimer
->
start
();
emit
mInstance
->
linphoneC
oreCreated
();
emit
mInstance
->
c
oreCreated
();
}
);
...
...
@@ -88,6 +88,8 @@ VcardModel *CoreManager::createDetachedVcardModel () {
}
void
CoreManager
::
forceRefreshRegisters
()
{
Q_ASSERT
(
mCore
!=
nullptr
);
qInfo
()
<<
QStringLiteral
(
"Refresh registers."
);
mCore
->
refreshRegisters
();
}
...
...
linphone-desktop/src/components/core/CoreManager.hpp
View file @
3647ed9c
...
...
@@ -48,10 +48,12 @@ public:
~
CoreManager
()
=
default
;
std
::
shared_ptr
<
linphone
::
Core
>
getCore
()
{
Q_ASSERT
(
mCore
!=
nullptr
);
return
mCore
;
}
std
::
shared_ptr
<
CoreHandlers
>
getHandlers
()
{
Q_ASSERT
(
mHandlers
!=
nullptr
);
return
mHandlers
;
}
...
...
@@ -72,22 +74,27 @@ public:
// ---------------------------------------------------------------------------
CallsListModel
*
getCallsListModel
()
const
{
Q_ASSERT
(
mCallsListModel
!=
nullptr
);
return
mCallsListModel
;
}
ContactsListModel
*
getContactsListModel
()
const
{
Q_ASSERT
(
mContactsListModel
!=
nullptr
);
return
mContactsListModel
;
}
SipAddressesModel
*
getSipAddressesModel
()
const
{
Q_ASSERT
(
mSipAddressesModel
!=
nullptr
);
return
mSipAddressesModel
;
}
SettingsModel
*
getSettingsModel
()
const
{
Q_ASSERT
(
mSettingsModel
!=
nullptr
);
return
mSettingsModel
;
}
AccountSettingsModel
*
getAccountSettingsModel
()
const
{
Q_ASSERT
(
mAccountSettingsModel
!=
nullptr
);
return
mAccountSettingsModel
;
}
...
...
@@ -99,6 +106,7 @@ public:
static
void
uninit
();
static
CoreManager
*
getInstance
()
{
Q_ASSERT
(
mInstance
!=
nullptr
);
return
mInstance
;
}
...
...
@@ -111,7 +119,7 @@ public:
Q_INVOKABLE
void
forceRefreshRegisters
();
signals:
void
linphoneC
oreCreated
();
void
c
oreCreated
();
private:
CoreManager
(
QObject
*
parent
,
const
QString
&
configPath
);
...
...
linphone-desktop/ui/views/App/Main/MainWindow.qml
View file @
3647ed9c
...
...
@@ -60,7 +60,7 @@ ApplicationWindow {
Connections
{
target
:
CoreManager
on
Linphone
CoreCreated
:
mainLoader
.
active
=
true
onCoreCreated
:
mainLoader
.
active
=
true
}
Shortcut
{
...
...
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