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
=== modified file 'WorkerModelLoader.qml'
--- WorkerModelLoader.qml 2014-10-28 04:03:06 +0000
+++ WorkerModelLoader.qml 2014-10-29 02:54:22 +0000
@@ -26,7 +26,7 @@
26 property bool canLoad: true26 property bool canLoad: true
27 property bool completed: false27 property bool completed: false
28 property int i: 028 property int i: 0
29 property var list: null29 property var list
30 property var model30 property var model
31 property bool preLoadComplete: false31 property bool preLoadComplete: false
32 property int syncFactor: 532 property int syncFactor: 5
@@ -34,11 +34,11 @@
34 onCanLoadChanged: {34 onCanLoadChanged: {
35 /* If canLoad has been set back to true then check if there are any35 /* If canLoad has been set back to true then check if there are any
36 remaining items to load in the model */36 remaining items to load in the model */
37 if (canLoad && list !== null && !completed) {37 if (canLoad && list !== undefined && !completed) {
38 process();38 process();
39 }39 }
4040
41 if (!canLoad) { // sync any pending changes when canLoad changes41 if (!canLoad && i !== 0) { // sync any pending changes when canLoad changes
42 sync()42 sync()
43 }43 }
44 }44 }
@@ -50,7 +50,7 @@
5050
51 onMessage: {51 onMessage: {
52 if (messageObject.sync === true) {52 if (messageObject.sync === true) {
53 if (list !== null && i >= list.length) { // if synced check if list now complete53 if (list !== undefined && i >= list.length) { // if synced check if list now complete
54 completed = true54 completed = true
55 }55 }
5656
@@ -75,7 +75,7 @@
75 }75 }
7676
77 function clear() {77 function clear() {
78 if (list !== null) {78 if (list !== undefined) {
79 sendMessage({'clear': true, 'model': model})79 sendMessage({'clear': true, 'model': model})
80 }80 }
81 }81 }
8282
=== modified file 'music-app.qml'
--- music-app.qml 2014-10-28 19:44:58 +0000
+++ music-app.qml 2014-10-29 02:54:22 +0000
@@ -534,7 +534,6 @@
534 WorkerModelLoader {534 WorkerModelLoader {
535 id: queueLoaderWorker535 id: queueLoaderWorker
536 canLoad: false536 canLoad: false
537 list: Library.getQueue()
538 model: trackQueue.model537 model: trackQueue.model
539 syncFactor: 10538 syncFactor: 10
540539
@@ -558,6 +557,7 @@
558557
559 // allow the queue loader to start558 // allow the queue loader to start
560 queueLoaderWorker.canLoad = !Library.isQueueEmpty()559 queueLoaderWorker.canLoad = !Library.isQueueEmpty()
560 queueLoaderWorker.list = Library.getQueue()
561561
562 // everything else562 // everything else
563 loading.visible = true563 loading.visible = true

Subscribers

People subscribed via source and target branches