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
1a2e5e5e
Commit
1a2e5e5e
authored
Jun 15, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(CoreManager): create main components at core startup
parent
5695e8ac
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
27 deletions
+28
-27
CoreHandlers.cpp
src/components/core/CoreHandlers.cpp
+9
-12
CoreHandlers.hpp
src/components/core/CoreHandlers.hpp
+0
-1
CoreManager.cpp
src/components/core/CoreManager.cpp
+16
-12
CoreManager.hpp
src/components/core/CoreManager.hpp
+1
-0
linphone
submodules/linphone
+1
-1
MainWindow.qml
ui/views/App/Main/MainWindow.qml
+1
-1
No files found.
src/components/core/CoreHandlers.cpp
View file @
1a2e5e5e
...
@@ -72,16 +72,6 @@ void CoreHandlers::handleCoreCreated () {
...
@@ -72,16 +72,6 @@ void CoreHandlers::handleCoreCreated () {
mCoreStartedLock
->
unlock
();
mCoreStartedLock
->
unlock
();
}
}
void
CoreHandlers
::
handleCoreStarted
()
{
mCoreStartedLock
->
lock
();
Q_ASSERT
(
mCoreStarted
==
false
);
mCoreStarted
=
true
;
notifyCoreStarted
();
mCoreStartedLock
->
unlock
();
}
void
CoreHandlers
::
notifyCoreStarted
()
{
void
CoreHandlers
::
notifyCoreStarted
()
{
if
(
mCoreCreated
&&
mCoreStarted
)
if
(
mCoreCreated
&&
mCoreStarted
)
scheduleFunctionInApp
(
scheduleFunctionInApp
(
...
@@ -128,8 +118,15 @@ void CoreHandlers::onGlobalStateChanged (
...
@@ -128,8 +118,15 @@ void CoreHandlers::onGlobalStateChanged (
linphone
::
GlobalState
gstate
,
linphone
::
GlobalState
gstate
,
const
string
&
const
string
&
)
{
)
{
if
(
gstate
==
linphone
::
GlobalStateOn
)
if
(
gstate
==
linphone
::
GlobalStateOn
)
{
handleCoreStarted
();
mCoreStartedLock
->
lock
();
Q_ASSERT
(
mCoreStarted
==
false
);
mCoreStarted
=
true
;
notifyCoreStarted
();
mCoreStartedLock
->
unlock
();
}
}
}
void
CoreHandlers
::
onCallStatsUpdated
(
void
CoreHandlers
::
onCallStatsUpdated
(
...
...
src/components/core/CoreHandlers.hpp
View file @
1a2e5e5e
...
@@ -52,7 +52,6 @@ signals:
...
@@ -52,7 +52,6 @@ signals:
private:
private:
void
handleCoreCreated
();
void
handleCoreCreated
();
void
handleCoreStarted
();
void
notifyCoreStarted
();
void
notifyCoreStarted
();
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
...
...
src/components/core/CoreManager.cpp
View file @
1a2e5e5e
...
@@ -46,18 +46,22 @@ CoreManager *CoreManager::mInstance = nullptr;
...
@@ -46,18 +46,22 @@ CoreManager *CoreManager::mInstance = nullptr;
CoreManager
::
CoreManager
(
QObject
*
parent
,
const
QString
&
configPath
)
:
QObject
(
parent
),
mHandlers
(
make_shared
<
CoreHandlers
>
(
this
))
{
CoreManager
::
CoreManager
(
QObject
*
parent
,
const
QString
&
configPath
)
:
QObject
(
parent
),
mHandlers
(
make_shared
<
CoreHandlers
>
(
this
))
{
mPromiseBuild
=
QtConcurrent
::
run
(
this
,
&
CoreManager
::
createLinphoneCore
,
configPath
);
mPromiseBuild
=
QtConcurrent
::
run
(
this
,
&
CoreManager
::
createLinphoneCore
,
configPath
);
QObject
::
connect
(
&
mPromiseWatcher
,
&
QFutureWatcher
<
void
>::
finished
,
this
,
[]()
{
QObject
::
connect
(
&
mPromiseWatcher
,
&
QFutureWatcher
<
void
>::
finished
,
this
,
[]
{
mInstance
->
mCallsListModel
=
new
CallsListModel
(
mInstance
);
qInfo
()
<<
QStringLiteral
(
"Core created. Enable iterate."
);
mInstance
->
mContactsListModel
=
new
ContactsListModel
(
mInstance
);
mInstance
->
mCbsTimer
->
start
();
mInstance
->
mSipAddressesModel
=
new
SipAddressesModel
(
mInstance
);
mInstance
->
mSettingsModel
=
new
SettingsModel
(
mInstance
);
emit
mInstance
->
coreCreated
();
mInstance
->
mAccountSettingsModel
=
new
AccountSettingsModel
(
mInstance
);
});
qInfo
()
<<
QStringLiteral
(
"Core created. Enable iterate."
);
QObject
::
connect
(
mHandlers
.
get
(),
&
CoreHandlers
::
coreStarted
,
this
,
[]
{
mInstance
->
mCbsTimer
->
start
();
mInstance
->
mCallsListModel
=
new
CallsListModel
(
mInstance
);
mInstance
->
mContactsListModel
=
new
ContactsListModel
(
mInstance
);
emit
mInstance
->
coreCreated
();
mInstance
->
mSipAddressesModel
=
new
SipAddressesModel
(
mInstance
);
});
mInstance
->
mSettingsModel
=
new
SettingsModel
(
mInstance
);
mInstance
->
mAccountSettingsModel
=
new
AccountSettingsModel
(
mInstance
);
emit
mInstance
->
coreStarted
();
});
mPromiseWatcher
.
setFuture
(
mPromiseBuild
);
mPromiseWatcher
.
setFuture
(
mPromiseBuild
);
}
}
...
...
src/components/core/CoreManager.hpp
View file @
1a2e5e5e
...
@@ -121,6 +121,7 @@ public:
...
@@ -121,6 +121,7 @@ public:
signals:
signals:
void
coreCreated
();
void
coreCreated
();
void
coreStarted
();
private:
private:
CoreManager
(
QObject
*
parent
,
const
QString
&
configPath
);
CoreManager
(
QObject
*
parent
,
const
QString
&
configPath
);
...
...
linphone
@
e3365011
Subproject commit
4c291e2c5a32711a1176459d74ed405cf225f706
Subproject commit
e3365011df5d5281fed91beb91fa928ac3568f60
ui/views/App/Main/MainWindow.qml
View file @
1a2e5e5e
...
@@ -51,7 +51,7 @@ ApplicationWindow {
...
@@ -51,7 +51,7 @@ ApplicationWindow {
Connections
{
Connections
{
target
:
CoreManager
target
:
CoreManager
onCore
Crea
ted
:
mainLoader
.
active
=
true
onCore
Star
ted
:
mainLoader
.
active
=
true
}
}
Shortcut
{
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