Merge lp:~aacid/unity8/previewZoomableImageModelChange into lp:unity8

Proposed by Albert Astals Cid on 2016-04-04
Status: Merged
Approved by: Michael Zanetti on 2016-04-06
Approved revision: 2324
Merged at revision: 2387
Proposed branch: lp:~aacid/unity8/previewZoomableImageModelChange
Merge into: lp:unity8
Prerequisite: lp:~aacid/unity8/previewIconActionsModelChange
Diff against target: 90 lines (+30/-8)
2 files modified
qml/Dash/Previews/PreviewZoomableImage.qml (+13/-8)
tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml (+17/-0)
To merge this branch: bzr merge lp:~aacid/unity8/previewZoomableImageModelChange
Reviewer Review Type Date Requested Status
Michael Zanetti (community) 2016-04-04 Approve on 2016-04-06
Unity8 CI Bot continuous-integration Needs Fixing on 2016-04-04
Review via email: mp+290856@code.launchpad.net

Commit Message

Reload Preview Zoomable Image source if it gets updated

Description of the Change

 * Are there any related MPs required for this MP to build/function as expected?
Prereq

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * Did you make sure that your branch does not contain spurious tags?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2323
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/922/
Executed test runs:
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/513
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial,testname=qmluitests.sh/513
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=autopilot.sh/513/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1257
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1228
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/1228
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1226
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1226/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/1226
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/1226/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1226
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1226/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/1226
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/1226/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1226
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1226/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/1226
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/1226/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/922/rebuild

review: Needs Fixing (continuous-integration)
2324. By Albert Astals Cid on 2016-04-04

Merge lp:~aacid/unity8/previewIconActionsModelChange

Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2324
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/924/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/515
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial,testname=qmluitests.sh/515
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=autopilot.sh/515/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1259
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1230
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/1230
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1228
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1228/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/1228
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/1228/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1228
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1228/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/1228
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/1228/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1228
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1228/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/1228
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/1228/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/924/rebuild

review: Needs Fixing (continuous-integration)
Michael Zanetti (mzanetti) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?

yes

 * Did CI run pass? If not, please explain why.

yes

 * Did you make sure that the branch does not contain spurious tags?

yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Dash/Previews/PreviewZoomableImage.qml'
2--- qml/Dash/Previews/PreviewZoomableImage.qml 2016-01-25 10:05:51 +0000
3+++ qml/Dash/Previews/PreviewZoomableImage.qml 2016-04-04 11:07:49 +0000
4@@ -34,6 +34,8 @@
5
6 property Item rootItem: QuickUtils.rootItem(root)
7
8+ readonly property var imageUrl: widgetData["source"] || widgetData["fallback"] || ""
9+
10 LazyImage {
11 id: lazyImage
12 objectName: "lazyImage"
13@@ -42,7 +44,7 @@
14 right: parent.right
15 }
16 scaleTo: "width"
17- source: widgetData["source"] || widgetData["fallback"] || ""
18+ source: root.imageUrl
19 asynchronous: true
20 useUbuntuShape: false
21 pressed: mouseArea.pressed
22@@ -59,11 +61,12 @@
23
24 Connections {
25 target: lazyImage.sourceImage
26- // If modelData would change after failing to load it would not be
27- // reloaded since the source binding is destroyed by the source = fallback
28- // But at the moment the model never changes
29 onStatusChanged: if (lazyImage.sourceImage.status === Image.Error) lazyImage.sourceImage.source = widgetData["fallback"];
30 }
31+ Connections {
32+ target: root
33+ onImageUrlChanged: lazyImage.sourceImage.source = root.imageUrl;
34+ }
35
36 PreviewMediaToolbar {
37 id: toolbar
38@@ -86,12 +89,14 @@
39
40 delegate: ZoomableImage {
41 anchors.fill: parent
42- source: widgetData["source"] || widgetData["fallback"] || ""
43+ source: root.imageUrl
44 zoomable: widgetData["zoomable"] ? widgetData["zoomable"] : false
45- // If modelData would change after failing to load it would not be
46- // reloaded since the source binding is destroyed by the source = fallback
47- // But at the moment the model never changes
48 onStatusChanged: if (status === Image.Error) source = widgetData["fallback"];
49+
50+ Connections {
51+ target: root
52+ onImageUrlChanged: source = root.imageUrl;
53+ }
54 }
55 }
56 }
57
58=== modified file 'tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml'
59--- tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml 2016-01-08 14:19:08 +0000
60+++ tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml 2016-04-04 11:07:49 +0000
61@@ -44,6 +44,11 @@
62 "fallback": "../../graphics/phone_background.jpg"
63 }
64
65+ property var widgetData4: {
66+ "source": "fadsasf",
67+ "fallback": "../../graphics/phone_background.jpg"
68+ }
69+
70 Loader {
71 id: loader
72 width: parent.width
73@@ -112,5 +117,17 @@
74 waitForRendering(lazyImage);
75 tryCompare(lazyImage, "state", "ready");
76 }
77+
78+ function test_fallback_then_source() {
79+ zoomableImage.widgetData = widgetData4;
80+ waitForRendering(zoomableImage);
81+ waitForRendering(lazyImage);
82+ tryCompare(lazyImage, "state", "ready");
83+ verify(lazyImage.sourceImage.source.toString().indexOf("phone_background") > -1);
84+ zoomableImage.widgetData["source"] = "../../graphics/tablet_background.jpg"
85+ zoomableImage.widgetDataChanged();
86+ tryCompare(lazyImage, "state", "ready");
87+ verify(lazyImage.sourceImage.source.toString().indexOf("tablet_background") > -1);
88+ }
89 }
90 }

Subscribers

People subscribed via source and target branches