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
ad7d3cd0
Commit
ad7d3cd0
authored
Jan 24, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(ui/modules/Linphone/Calls/Calls): refresh correctly the selected call
parent
c821636a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
5 deletions
+34
-5
Calls.qml
tests/ui/modules/Linphone/Calls/Calls.qml
+33
-4
utils.js
tests/ui/scripts/Utils/utils.js
+1
-1
No files found.
tests/ui/modules/Linphone/Calls/Calls.qml
View file @
ad7d3cd0
...
@@ -11,7 +11,7 @@ ListView {
...
@@ -11,7 +11,7 @@ ListView {
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
readonly
property
var
selectedCall
:
currentIndex
>=
0
?
model
.
data
(
model
.
index
(
currentIndex
,
0
))
:
nu
ll
readonly
property
var
selectedCall
:
smartConnect
.
selectedCa
ll
property
var
_mapStatusToParams
property
var
_mapStatusToParams
...
@@ -156,25 +156,54 @@ ListView {
...
@@ -156,25 +156,54 @@ ListView {
}
}
}
}
// ---------------------------------------------------------------------------
// Update the current selected call and the current index.
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
SmartConnect
{
SmartConnect
{
id
:
smartConnect
property
var
selectedCall
Component.onCompleted
:
{
Component.onCompleted
:
{
this
.
connect
(
model
,
'
rowsAboutToBeRemoved
'
,
function
(
_
,
first
,
last
)
{
this
.
connect
(
model
,
'
rowsAboutToBeRemoved
'
,
function
(
_
,
first
,
last
)
{
var
index
=
calls
.
currentIndex
var
index
=
calls
.
currentIndex
if
(
index
>=
first
&&
index
<=
last
)
{
// Remove current call.
if
(
index
>=
first
&&
index
<=
last
)
{
// Remove current call.
if
(
model
.
rowCount
()
-
(
last
-
first
+
1
)
<=
0
)
{
if
(
model
.
rowCount
()
-
(
last
-
first
+
1
)
<=
0
)
{
calls
.
currentIndex
=
-
1
selectedCall
=
null
}
else
{
}
else
{
calls
.
currentIndex
=
0
if
(
first
===
0
)
{
selectedCall
=
model
.
data
(
model
.
index
(
last
+
1
,
0
))
}
else
{
selectedCall
=
model
.
data
(
model
.
index
(
0
,
0
))
}
}
}
}
else
if
(
last
<
index
)
{
// Remove before current call.
}
})
this
.
connect
(
model
,
'
rowsRemoved
'
,
function
(
_
,
first
,
last
)
{
var
index
=
calls
.
currentIndex
// The current call has been removed.
if
(
index
>=
first
&&
index
<=
last
)
{
if
(
model
.
rowCount
()
===
0
)
{
calls
.
currentIndex
=
-
1
// No calls.
}
else
{
calls
.
currentIndex
=
0
// The first call becomes the selected call.
}
}
// Update the current index of the selected call if it was after the removed calls.
else
if
(
last
<
index
)
{
calls
.
currentIndex
=
index
-
(
last
-
first
+
1
)
calls
.
currentIndex
=
index
-
(
last
-
first
+
1
)
}
}
})
})
// The last inserted element become the selected call.
this
.
connect
(
model
,
'
rowsInserted
'
,
function
(
_
,
first
,
last
)
{
this
.
connect
(
model
,
'
rowsInserted
'
,
function
(
_
,
first
,
last
)
{
calls
.
currentIndex
=
first
calls
.
currentIndex
=
first
selectedCall
=
model
.
data
(
model
.
index
(
first
,
0
))
})
})
}
}
}
}
...
...
tests/ui/scripts/Utils/utils.js
View file @
ad7d3cd0
...
@@ -39,7 +39,7 @@ function encodeTextToQmlRichFormat (text, options) {
...
@@ -39,7 +39,7 @@ function encodeTextToQmlRichFormat (text, options) {
}
}
text
=
text
text
=
text
.
replace
(
/&/g
,
'
&
'
)
.
replace
(
/&/g
,
'
&
'
)
// TODO: deal correctly with urls and `&m`
.
replace
(
/</g
,
'
\
u2063<
'
)
.
replace
(
/</g
,
'
\
u2063<
'
)
.
replace
(
/>/g
,
'
\
u2063>
'
)
.
replace
(
/>/g
,
'
\
u2063>
'
)
.
replace
(
/
\r\n
|
\n
/g
,
'
<br/>
'
)
.
replace
(
/
\r\n
|
\n
/g
,
'
<br/>
'
)
...
...
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