Merge lp:~abreu-alexandre/unity-webapps-qml/backport-oxide-contenthub-fixes-1409 into lp:unity-webapps-qml/rtm-14.09

Proposed by Alexandre Abreu on 2014-12-05
Status: Merged
Approved by: Alexandre Abreu on 2015-03-10
Approved revision: 136
Merged at revision: 140
Proposed branch: lp:~abreu-alexandre/unity-webapps-qml/backport-oxide-contenthub-fixes-1409
Merge into: lp:unity-webapps-qml/rtm-14.09
Diff against target: 47 lines (+8/-14)
1 file modified
src/Ubuntu/UnityWebApps/bindings/content-hub/backend/content-hub.js (+8/-14)
To merge this branch: bzr merge lp:~abreu-alexandre/unity-webapps-qml/backport-oxide-contenthub-fixes-1409
Reviewer Review Type Date Requested Status
Alexandre Abreu (community) Approve on 2015-02-19
Review via email: mp+243859@code.launchpad.net

Commit message

Fix content hub getpeers()

Description of the change

Fix content hub getpeers()

In order to test:

- create an HTML5 app from Qtc,
- make sure that your apparmor profile has the content_exchange policy,
- replace the content of the index.html and js/app.js with the ones found here http://bazaar.launchpad.net/~webapps/unity-webapps-qml/trunk/files/head:/examples/api-bindings/content-hub/www/
- launch the application on the device,
- make sure that the application lists (including at least the Gallery app and the Camera app),

To post a comment you must log in.
134. By Alexandre Abreu on 2015-01-14

Backport a testability improvement (webapps instrumentation) from trunk that allows some tests from external packages to run.

135. By CI Train Bot Account on 2015-01-14

Releasing 0.1+15.04.20150114~rtm-0ubuntu1

136. By Alexandre Abreu on 2015-02-18

fix content hub getpeers()

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Ubuntu/UnityWebApps/bindings/content-hub/backend/content-hub.js'
2--- src/Ubuntu/UnityWebApps/bindings/content-hub/backend/content-hub.js 2014-06-17 13:53:49 +0000
3+++ src/Ubuntu/UnityWebApps/bindings/content-hub/backend/content-hub.js 2015-02-18 13:55:32 +0000
4@@ -643,8 +643,7 @@
5 return;
6 }
7
8- var statement = "import QtQuick 2.0; import Ubuntu.Content 0.1; ContentPeerModel {";
9- var filterParams = {};
10+ var statement = "import QtQuick 2.0; import Ubuntu.Content 0.1; ContentPeerModel { ";
11 if (filters.contentType) {
12 statement += " contentType: ContentType." + filters.contentType + ";";
13 }
14@@ -654,18 +653,14 @@
15 statement += " }";
16
17 var peerModel = Qt.createQmlObject(statement, backendDelegate.parent());
18- var onPeersFound = function() {
19- var peers = peerModel.peers;
20+ var peers = peerModel.peers;
21
22- var wrappedPeers = [];
23- for (var i = 0; i < peers.length; ++i) {
24- var wrappedPeer = new ContentPeer(peers[i]);
25- wrappedPeers.push(wrappedPeer.serialize());
26- }
27- peerModel.onFindPeersCompleted.disconnect(onPeersFound);
28- callback(wrappedPeers);
29- };
30- peerModel.onFindPeersCompleted.connect(onPeersFound);
31+ var wrappedPeers = [];
32+ for (var i = 0; i < peers.length; ++i) {
33+ var wrappedPeer = new ContentPeer(peers[i]);
34+ wrappedPeers.push(wrappedPeer.serialize());
35+ }
36+ callback(wrappedPeers);
37 },
38
39 getStore: function(scope, callback) {
40@@ -692,7 +687,6 @@
41 }
42
43 var statement = "import QtQuick 2.0; import Ubuntu.Content 0.1; ContentPeerPicker {";
44- var filterParams = {};
45 if (filters.contentType) {
46 statement += " contentType: ContentType." + filters.contentType + "";
47 }

Subscribers

People subscribed via source and target branches

to all changes: