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
25ea2819
Commit
25ea2819
authored
May 22, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(src/components/calls/CallsListProxyModel): handle conference changes on calls
parent
777017f4
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
13 deletions
+47
-13
CallModel.cpp
linphone-desktop/src/components/call/CallModel.cpp
+13
-0
CallModel.hpp
linphone-desktop/src/components/call/CallModel.hpp
+12
-0
CallsListModel.cpp
linphone-desktop/src/components/calls/CallsListModel.cpp
+21
-12
CallsListProxyModel.cpp
...hone-desktop/src/components/calls/CallsListProxyModel.cpp
+1
-1
No files found.
linphone-desktop/src/components/call/CallModel.cpp
View file @
25ea2819
...
...
@@ -197,6 +197,8 @@ void CallModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call,
if
(
call
!=
mCall
)
return
;
updateIsInConference
();
switch
(
state
)
{
case
linphone
:
:
CallStateError
:
case
linphone
:
:
CallStateEnd
:
...
...
@@ -251,6 +253,15 @@ void CallModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call,
// -----------------------------------------------------------------------------
void
CallModel
::
updateIsInConference
()
{
if
(
mIsInConference
!=
!!
mCall
->
getConference
())
{
mIsInConference
=
!
mIsInConference
;
emit
isInConferenceChanged
(
mIsInConference
);
}
}
// -----------------------------------------------------------------------------
void
CallModel
::
stopAutoAnswerTimer
()
const
{
QTimer
*
timer
=
findChild
<
QTimer
*>
(
AUTO_ANSWER_OBJECT_NAME
,
Qt
::
FindDirectChildrenOnly
);
if
(
timer
)
{
...
...
@@ -259,6 +270,8 @@ void CallModel::stopAutoAnswerTimer () const {
}
}
// -----------------------------------------------------------------------------
CallModel
::
CallStatus
CallModel
::
getStatus
()
const
{
switch
(
mCall
->
getState
())
{
case
linphone
:
:
CallStateConnected
:
...
...
linphone-desktop/src/components/call/CallModel.hpp
View file @
25ea2819
...
...
@@ -37,6 +37,8 @@ class CallModel : public QObject {
Q_PROPERTY
(
bool
isOutgoing
READ
isOutgoing
CONSTANT
);
Q_PROPERTY
(
bool
isInConference
READ
isInConference
NOTIFY
isInConferenceChanged
);
Q_PROPERTY
(
int
duration
READ
getDuration
CONSTANT
);
// Constants but called with a timer in qml.
Q_PROPERTY
(
float
quality
READ
getQuality
CONSTANT
);
Q_PROPERTY
(
float
microVu
READ
getMicroVu
CONSTANT
);
...
...
@@ -94,6 +96,7 @@ public:
signals:
void
callErrorChanged
(
const
QString
&
callError
);
void
isInConferenceChanged
(
bool
status
);
void
microMutedChanged
(
bool
status
);
void
recordingChanged
(
bool
status
);
void
statsUpdated
();
...
...
@@ -106,10 +109,17 @@ private:
void
stopAutoAnswerTimer
()
const
;
CallStatus
getStatus
()
const
;
bool
isOutgoing
()
const
{
return
mCall
->
getDir
()
==
linphone
::
CallDirOutgoing
;
}
bool
isInConference
()
const
{
return
mIsInConference
;
}
void
updateIsInConference
();
void
acceptWithAutoAnswerDelay
();
QString
getCallError
()
const
;
...
...
@@ -139,6 +149,8 @@ private:
QString
iceStateToString
(
linphone
::
IceState
state
)
const
;
bool
mIsInConference
=
false
;
bool
mPausedByRemote
=
false
;
bool
mPausedByUser
=
false
;
bool
mRecording
=
false
;
...
...
linphone-desktop/src/components/calls/CallsListModel.cpp
View file @
25ea2819
...
...
@@ -37,15 +37,18 @@ using namespace std;
// =============================================================================
inline
QList
<
CallModel
*>::
iterator
findCallModel
(
QList
<
CallModel
*>
&
list
,
const
shared_ptr
<
linphone
::
Call
>
&
call
)
{
return
find_if
(
list
.
begin
(),
list
.
end
(),
[
call
](
CallModel
*
callModel
)
{
inline
int
findCallIndex
(
QList
<
CallModel
*>
&
list
,
const
shared_ptr
<
linphone
::
Call
>
&
call
)
{
auto
it
=
find_if
(
list
.
begin
(),
list
.
end
(),
[
call
](
CallModel
*
callModel
)
{
return
call
==
callModel
->
getCall
();
}
);
});
Q_ASSERT
(
it
!=
list
.
end
());
return
static_cast
<
int
>
(
distance
(
list
.
begin
(),
it
));
}
inline
int
findCallIndex
(
QList
<
CallModel
*>
&
list
,
const
CallModel
&
callModel
)
{
return
findCallIndex
(
list
,
callModel
.
getCall
());
}
// -----------------------------------------------------------------------------
...
...
@@ -136,7 +139,7 @@ void CallsListModel::handleCallStateChanged (const std::shared_ptr<linphone::Cal
break
;
case
linphone
:
:
CallStateStreamsRunning
:
{
int
index
=
static_cast
<
int
>
(
distance
(
mList
.
begin
(),
findCallModel
(
mList
,
call
))
);
int
index
=
findCallIndex
(
mList
,
call
);
emit
callRunning
(
index
,
&
call
->
getData
<
CallModel
>
(
"call-model"
));
}
break
;
...
...
@@ -173,11 +176,17 @@ void CallsListModel::addCall (const shared_ptr<linphone::Call> &call) {
App
::
smartShowWindow
(
App
::
getInstance
()
->
getCallsWindow
());
CallModel
*
callModel
=
new
CallModel
(
call
);
qInfo
()
<<
QStringLiteral
(
"Add call:"
)
<<
callModel
;
App
::
getInstance
()
->
getEngine
()
->
setObjectOwnership
(
callModel
,
QQmlEngine
::
CppOwnership
);
// This connection is (only) useful for `CallsListProxyModel`.
QObject
::
connect
(
callModel
,
&
CallModel
::
isInConferenceChanged
,
this
,
[
this
,
callModel
](
bool
)
{
int
id
=
findCallIndex
(
mList
,
*
callModel
);
emit
dataChanged
(
index
(
id
,
0
),
index
(
id
,
0
));
}
);
int
row
=
mList
.
count
();
beginInsertRows
(
QModelIndex
(),
row
,
row
);
...
...
linphone-desktop/src/components/calls/CallsListProxyModel.cpp
View file @
25ea2819
...
...
@@ -45,5 +45,5 @@ bool CallsListProxyModel::filterAcceptsRow (int sourceRow, const QModelIndex &so
const
QModelIndex
&
index
=
sourceModel
()
->
index
(
sourceRow
,
0
,
sourceParent
);
shared_ptr
<
linphone
::
Call
>
call
=
index
.
data
().
value
<
CallModel
*>
()
->
getCall
();
return
call
->
getConference
()
!
=
nullptr
;
return
call
->
getConference
()
=
=
nullptr
;
}
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