Merge lp:~ahayzen/music-app/remix-workerscript-console-errors into lp:music-app/remix

Proposed by Andrew Hayzen
Status: Merged
Approved by: Victor Thompson
Approved revision: 718
Merged at revision: 718
Proposed branch: lp:~ahayzen/music-app/remix-workerscript-console-errors
Merge into: lp:music-app/remix
Diff against target: 64 lines (+6/-6)
2 files modified
WorkerModelLoader.qml (+5/-5)
music-app.qml (+1/-1)
To merge this branch: bzr merge lp:~ahayzen/music-app/remix-workerscript-console-errors
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Victor Thompson Approve
Review via email: mp+239932@code.launchpad.net

Commit message

* Fix for console errors from WorkerScript at startup

Description of the change

* Fix for console errors from WorkerScript at startup

You shouldn't see any more "QQuickWorkerScript: Attempt to send message before WorkerScript establishment" when the app is starting.

To post a comment you must log in.
Revision history for this message
Victor Thompson (vthompson) wrote :

lgtm

Revision history for this message
Victor Thompson (vthompson) :
review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'WorkerModelLoader.qml'
2--- WorkerModelLoader.qml 2014-10-28 04:03:06 +0000
3+++ WorkerModelLoader.qml 2014-10-29 02:54:22 +0000
4@@ -26,7 +26,7 @@
5 property bool canLoad: true
6 property bool completed: false
7 property int i: 0
8- property var list: null
9+ property var list
10 property var model
11 property bool preLoadComplete: false
12 property int syncFactor: 5
13@@ -34,11 +34,11 @@
14 onCanLoadChanged: {
15 /* If canLoad has been set back to true then check if there are any
16 remaining items to load in the model */
17- if (canLoad && list !== null && !completed) {
18+ if (canLoad && list !== undefined && !completed) {
19 process();
20 }
21
22- if (!canLoad) { // sync any pending changes when canLoad changes
23+ if (!canLoad && i !== 0) { // sync any pending changes when canLoad changes
24 sync()
25 }
26 }
27@@ -50,7 +50,7 @@
28
29 onMessage: {
30 if (messageObject.sync === true) {
31- if (list !== null && i >= list.length) { // if synced check if list now complete
32+ if (list !== undefined && i >= list.length) { // if synced check if list now complete
33 completed = true
34 }
35
36@@ -75,7 +75,7 @@
37 }
38
39 function clear() {
40- if (list !== null) {
41+ if (list !== undefined) {
42 sendMessage({'clear': true, 'model': model})
43 }
44 }
45
46=== modified file 'music-app.qml'
47--- music-app.qml 2014-10-28 19:44:58 +0000
48+++ music-app.qml 2014-10-29 02:54:22 +0000
49@@ -534,7 +534,6 @@
50 WorkerModelLoader {
51 id: queueLoaderWorker
52 canLoad: false
53- list: Library.getQueue()
54 model: trackQueue.model
55 syncFactor: 10
56
57@@ -558,6 +557,7 @@
58
59 // allow the queue loader to start
60 queueLoaderWorker.canLoad = !Library.isQueueEmpty()
61+ queueLoaderWorker.list = Library.getQueue()
62
63 // everything else
64 loading.visible = true

Subscribers

People subscribed via source and target branches