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
38725089
Commit
38725089
authored
Oct 24, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(utils.js): `parent` is now a explicit parameter of `setTimeout`
parent
37e7954c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
8 deletions
+6
-8
InvertedMouseArea.qml
tests/ui/modules/Common/InvertedMouseArea.qml
+1
-1
utils.js
tests/ui/scripts/Utils/utils.js
+2
-4
utils.spec.qml
tests/ui/scripts/Utils/utils.spec.qml
+3
-3
No files found.
tests/ui/modules/Common/InvertedMouseArea.qml
View file @
38725089
...
...
@@ -95,7 +95,7 @@ Item {
// call.
//
// The timeout is destroyed with the `MouseArea` component.
_timeout
=
Utils
.
setTimeout
.
call
(
_timeout
=
Utils
.
setTimeout
(
this
,
0
,
item
.
pressed
.
bind
(
this
)
)
}
...
...
tests/ui/scripts/Utils/utils.js
View file @
38725089
...
...
@@ -84,13 +84,11 @@ function snakeToCamel (s) {
// -------------------------------------------------------------------
// A copy of `Window.setTimeout` from js.
// Use setTimeout.call(parentContext, delayTime, cb) to use it.
//
// delay is in milliseconds.
function
setTimeout
(
delay
,
cb
)
{
function
setTimeout
(
parent
,
delay
,
cb
)
{
var
timer
=
new
(
function
(
parent
)
{
return
Qt
.
createQmlObject
(
'
import QtQuick 2.7; Timer { }
'
,
parent
)
})(
this
)
})(
parent
)
timer
.
interval
=
delay
timer
.
repeat
=
false
...
...
tests/ui/scripts/Utils/utils.spec.qml
View file @
38725089
...
...
@@ -50,7 +50,7 @@ TestCase {
function
test_setTimeoutWithoutParent
()
{
try
{
Utils
.
setTimeout
(
0
,
function
()
{
Utils
.
setTimeout
(
null
,
0
,
function
()
{
fail
(
'
`setTimeout` was called without parent.
'
)
})
}
catch
(
e
)
{
...
...
@@ -67,7 +67,7 @@ TestCase {
function
test_setTimeout
(
data
)
{
var
failed
=
true
Utils
.
setTimeout
.
call
(
testCase
,
data
.
time
,
function
()
{
Utils
.
setTimeout
(
testCase
,
data
.
time
,
function
()
{
failed
=
false
})
...
...
@@ -93,7 +93,7 @@ TestCase {
function
test_clearTimeout
(
data
)
{
var
failed
=
false
var
timeout
=
Utils
.
setTimeout
.
call
(
testCase
,
data
.
time
,
function
()
{
var
timeout
=
Utils
.
setTimeout
(
testCase
,
data
.
time
,
function
()
{
failed
=
true
})
...
...
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