on xenial help sign in
Renamed properties
f86104cAndrea Cimitan
qml/Dash/Previews/PreviewSharing.qml+8−6
@@ -23,10 +23,10 @@ Item {
23 implicitHeight: button.height
23 implicitHeight: button.height
24 implicitWidth: button.width
24 implicitWidth: button.width
25
25
26− property var shareUris
26+ property var shareData
27 readonly property bool isUrlExternal: url && url.indexOf("file:///") != 0 && url.indexOf("/") != 0
27 readonly property bool isUrlExternal: url && url.indexOf("file:///") != 0 && url.indexOf("/") != 0
28− readonly property string contentType: shareUris ? shareUris["contentType"] : ""
28+ readonly property string contentType: shareData ? shareData["contentType"] : ""
29− readonly property string url: shareUris ? shareUris["uri"] : ""
29+ readonly property var url: shareData ? shareData["uri"] : ""
30 readonly property Item rootItem: QuickUtils.rootItem(root)
30 readonly property Item rootItem: QuickUtils.rootItem(root)
31
31
32 visible: url != ""
32 visible: url != ""
@@ -78,9 +78,11 @@ Item {
78 var transfer = peer.request();
78 var transfer = peer.request();
79 if (transfer.state === ContentTransfer.InProgress) {
79 if (transfer.state === ContentTransfer.InProgress) {
80 var items = new Array();
80 var items = new Array();
81+ for (var i = 0; i < url.length; i++) {
81− var exportItem = exportItemComponent.createObject();
82+ var exportItem = exportItemComponent.createObject();
82− exportItem.url = url;
83+ exportItem.url = url[i];
83− items.push(exportItem);
84+ items.push(exportItem);
85+ }
84 transfer.items = items;
86 transfer.items = items;
85 transfer.state = ContentTransfer.Charged;
87 transfer.state = ContentTransfer.Charged;
86 }
88 }
qml/Dash/Previews/PreviewVideoPlayback.qml+1−1
@@ -92,7 +92,7 @@ PreviewWidget {
92 verticalCenter: parent.verticalCenter
92 verticalCenter: parent.verticalCenter
93 leftMargin: units.gu(1)
93 leftMargin: units.gu(1)
94 }
94 }
95− shareUris: widgetData["shareUris"]
95+ shareData: widgetData["shareData"]
96 }
96 }
97 }
97 }
98 }
98 }
qml/Dash/Previews/PreviewZoomableImage.qml+1−1
@@ -83,7 +83,7 @@ PreviewWidget {
83 verticalCenter: parent.verticalCenter
83 verticalCenter: parent.verticalCenter
84 leftMargin: units.gu(1)
84 leftMargin: units.gu(1)
85 }
85 }
86− shareUris: widgetData["shareUris"]
86+ shareData: widgetData["shareData"]
87 }
87 }
88 }
88 }
89 }
89 }
tests/qmltests/Dash/Previews/tst_PreviewSharing.qml+11−7
@@ -24,14 +24,18 @@ Rectangle {
24 id: root
24 id: root
25 width: units.gu(40)
25 width: units.gu(40)
26 height: units.gu(80)
26 height: units.gu(80)
27− color: Theme.palette.selected.background
27+ color: "black"
28
28
29− property var shareUris: {
29+ property var shareData: {
30+ "uri": [
30− "uri": "Text here",
31+ "Text here",
32+ "text here 2",
33+ "text here 3"
34+ ],
31 "contentType": "text"
35 "contentType": "text"
32 }
36 }
33
37
34− property var shareUrisNoUri: {
38+ property var shareDataNoUri: {
35 "uri": "",
39 "uri": "",
36 "contentType": "text"
40 "contentType": "text"
37 }
41 }
@@ -39,7 +43,7 @@ Rectangle {
39 PreviewSharing {
43 PreviewSharing {
40 id: previewSharing
44 id: previewSharing
41 anchors { left: parent.left; bottom: parent.bottom; }
45 anchors { left: parent.left; bottom: parent.bottom; }
42− shareUris: root.shareUris
46+ shareData: root.shareData
43 }
47 }
44
48
45 UT.UnityTestCase {
49 UT.UnityTestCase {
@@ -50,12 +54,12 @@ Rectangle {
50
54
51 function cleanup() {
55 function cleanup() {
52 peerPicker.visible = false;
56 peerPicker.visible = false;
53− previewSharing.shareUris = root.shareUris;
57+ previewSharing.shareData = root.shareData;
54 }
58 }
55
59
56 function test_visible() {
60 function test_visible() {
57 compare(previewSharing.visible, true);
61 compare(previewSharing.visible, true);
58− previewSharing.shareUris = shareUrisNoUri;
62+ previewSharing.shareData = shareDataNoUri;
59 compare(previewSharing.visible, false);
63 compare(previewSharing.visible, false);
60 }
64 }
61
65