Merge lp:~tpeeters/ubuntu-ui-toolkit/crossFadeImage_SourceSize_fix into lp:ubuntu-ui-toolkit
- crossFadeImage_SourceSize_fix
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Tim Peeters |
Approved revision: | 781 |
Merged at revision: | 798 |
Proposed branch: | lp:~tpeeters/ubuntu-ui-toolkit/crossFadeImage_SourceSize_fix |
Merge into: | lp:ubuntu-ui-toolkit |
Diff against target: |
143 lines (+71/-2) 4 files modified
CHANGES (+1/-0) components.api (+1/-1) modules/Ubuntu/Components/CrossFadeImage.qml (+43/-1) tests/unit/tst_components/tst_CrossFadeImage.qml (+26/-0) |
To merge this branch: | bzr merge lp:~tpeeters/ubuntu-ui-toolkit/crossFadeImage_SourceSize_fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
Tim Peeters | Approve | ||
Zsombor Egri | Needs Fixing | ||
Günter Schwann (community) | Approve | ||
Michael Zanetti (community) | Needs Information | ||
Review via email: mp+187454@code.launchpad.net |
Commit message
Update CrossFadeImage API so that sourceSize can be set by the applications.
* CHANGED in CrossFadeImage: readonly property size sourceSize TO property size sourceSize
Description of the change
PS Jenkins bot (ps-jenkins) wrote : | # |
Michael Zanetti (mzanetti) wrote : | # |
59 + } else if (internals.
Hmm... Can it be that internals.
No tests?
Günter Schwann (schwann) wrote : | # |
looks good, and helps fixing the issue decscribed in the bug
Tim Peeters (tpeeters) wrote : | # |
> 59 + } else if (internals.
> Qt.size(
> internals.
>
> Hmm... Can it be that internals.
> case setting the sourceSize would get lost if setting during that period. If
> it can't happen we can probably drop this check either. In any case I think
> the "internals.
> bound to currentImage and nextImage directly anyways.
apparently it can be null/undefined when the object is being created and image pointers are not yet set.
>
> No tests?
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:769
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:770
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:771
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:772
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Michael Zanetti (mzanetti) wrote : | # |
> > 59 + } else if (internals.
> > Qt.size(
> > internals.
> >
> > Hmm... Can it be that internals.
> > case setting the sourceSize would get lost if setting during that period. If
> > it can't happen we can probably drop this check either. In any case I think
> > the "internals.
> > bound to currentImage and nextImage directly anyways.
>
> apparently it can be null/undefined when the object is being created and image
> pointers are not yet set.
Yeah, this is what I meant. So doesn't this fail in that case?
I mean, if you're using it like this:
CrossFadeImage {
source: "foo.png"
sourceSize.
sourceSize.
}
Given that the whole thing is built up and sourceSize is set immediately, when loadingImage is still null. The sourceSize setting would just be discarded afaics. Unless the constructions happens before the property setting. In that case the check doesn't break anything, but is still useles..
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Zsombor Egri (zsombi) wrote : | # |
52 +
53 + onSourceSizeCha
qdoc failure given on this line. Also remember to merge trunk, there were issues with autopilot tests.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:774
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:776
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Tim Peeters (tpeeters) wrote : | # |
> > > 59 + } else if (internals.
> > > Qt.size(
> > > internals.
> > >
> > > Hmm... Can it be that internals.
> that
> > > case setting the sourceSize would get lost if setting during that period.
> If
> > > it can't happen we can probably drop this check either. In any case I
> think
> > > the "internals.
> > > bound to currentImage and nextImage directly anyways.
> >
> > apparently it can be null/undefined when the object is being created and
> image
> > pointers are not yet set.
>
> Yeah, this is what I meant. So doesn't this fail in that case?
>
> I mean, if you're using it like this:
>
> CrossFadeImage {
> source: "foo.png"
> sourceSize.height: 500
> sourceSize.width: 500
> }
>
> Given that the whole thing is built up and sourceSize is set immediately, when
> loadingImage is still null. The sourceSize setting would just be discarded
> afaics. Unless the constructions happens before the property setting. In that
> case the check doesn't break anything, but is still useles..
I added a test that checks for explicitly defined source sizes.
If no image is loaded yet, sourceSize is set to 0,0, and setting it implicitly will trigger a changed and will set forcedSourceSize, and as a result the image sourceSize will be ignored in the future. So it all seems good.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:777
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
ABORTED: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Francis Ginther (fginther) wrote : | # |
maguro device was stuck, re-building.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:777
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
UNSTABLE: http://
UNSTABLE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:778
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
UNSTABLE: http://
UNSTABLE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:779
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
UNSTABLE: http://
UNSTABLE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:779
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
UNSTABLE: http://
UNSTABLE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:780
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
UNSTABLE: http://
UNSTABLE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:781
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
UNSTABLE: http://
Click here to trigger a rebuild:
http://
Tim Peeters (tpeeters) wrote : | # |
let's see if stuff gets merged now.
Tim Peeters (tpeeters) wrote : | # |
just need positive CI results
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:781
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Tim Peeters (tpeeters) wrote : | # |
approved by jenkins??! woohoo!!! :)
Preview Diff
1 | === modified file 'CHANGES' |
2 | --- CHANGES 2013-10-02 06:38:07 +0000 |
3 | +++ CHANGES 2013-10-14 08:32:19 +0000 |
4 | @@ -55,6 +55,7 @@ |
5 | * ADDED IN Panel: function open() |
6 | * ADDED IN Panel: function close() |
7 | * DEPRECATED IN Panel: writable property opened. Will be made read-only. |
8 | +* CHANGED in CrossFadeImage: readonly property size sourceSize TO property size sourceSize |
9 | |
10 | Compatibility Breaks |
11 | ******************** |
12 | |
13 | === modified file 'components.api' |
14 | --- components.api 2013-10-03 06:27:08 +0000 |
15 | +++ components.api 2013-10-14 08:32:19 +0000 |
16 | @@ -42,7 +42,7 @@ |
17 | property int fillMode |
18 | property int fadeDuration |
19 | readonly property bool running |
20 | - readonly property size sourceSize |
21 | + property size sourceSize |
22 | readonly property int status |
23 | modules/Ubuntu/Components/DraggingArea.qml |
24 | MouseArea |
25 | |
26 | === modified file 'modules/Ubuntu/Components/CrossFadeImage.qml' |
27 | --- modules/Ubuntu/Components/CrossFadeImage.qml 2013-08-28 12:56:17 +0000 |
28 | +++ modules/Ubuntu/Components/CrossFadeImage.qml 2013-10-14 08:32:19 +0000 |
29 | @@ -81,8 +81,33 @@ |
30 | |
31 | /*! |
32 | The actual width and height of the loaded image |
33 | + This property holds the actual width and height of the loaded image. |
34 | + |
35 | + Unlike the width and height properties, which scale the painting of the image, |
36 | + this property sets the actual number of pixels stored for the loaded image so that large |
37 | + images do not use more memory than necessary. |
38 | + |
39 | + Note: Changing this property dynamically causes the image source to be reloaded, potentially |
40 | + even from the network, if it is not in the disk cache. |
41 | */ |
42 | - readonly property size sourceSize: Qt.size(internals.loadingImage.sourceSize.width, internals.loadingImage.sourceSize.height) |
43 | + // FIXME: Support resetting sourceSize |
44 | + property size sourceSize: internals.loadingImage ? Qt.size(internals.loadingImage.sourceSize.width, internals.loadingImage.sourceSize.height) : Qt.size(0, 0) |
45 | + |
46 | + Binding { |
47 | + target: crossFadeImage |
48 | + property: "sourceSize" |
49 | + value: internals.loadingImage ? Qt.size(internals.loadingImage.sourceSize.width, internals.loadingImage.sourceSize.height) : Qt.size(0, 0) |
50 | + when: internals.forcedSourceSize === undefined |
51 | + } |
52 | + |
53 | + /*! |
54 | + \internal |
55 | + */ |
56 | + onSourceSizeChanged: { |
57 | + if (internals.loadingImage && (sourceSize != Qt.size(internals.loadingImage.sourceSize.width, internals.loadingImage.sourceSize.height))) { |
58 | + internals.forcedSourceSize = sourceSize; |
59 | + } |
60 | + } |
61 | |
62 | /*! |
63 | \qmlproperty enumeration status |
64 | @@ -102,6 +127,11 @@ |
65 | id: internals |
66 | |
67 | /*! \internal |
68 | + Source size specified by the setting crossFadeImage.sourceSize. |
69 | + */ |
70 | + property size forcedSourceSize |
71 | + |
72 | + /*! \internal |
73 | Defines the image currently being shown |
74 | */ |
75 | property Image currentImage: image1 |
76 | @@ -130,6 +160,12 @@ |
77 | asynchronous: true |
78 | fillMode: parent.fillMode |
79 | z: 1 |
80 | + Binding { |
81 | + target: image1 |
82 | + property: "sourceSize" |
83 | + value: internals.forcedSourceSize |
84 | + when: internals.forcedSourceSize !== undefined |
85 | + } |
86 | } |
87 | |
88 | Image { |
89 | @@ -139,6 +175,12 @@ |
90 | asynchronous: true |
91 | fillMode: parent.fillMode |
92 | z: 0 |
93 | + Binding { |
94 | + target: image2 |
95 | + property: "sourceSize" |
96 | + value: internals.forcedSourceSize |
97 | + when: internals.forcedSourceSize !== undefined |
98 | + } |
99 | } |
100 | |
101 | /*! |
102 | |
103 | === modified file 'tests/unit/tst_components/tst_CrossFadeImage.qml' |
104 | --- tests/unit/tst_components/tst_CrossFadeImage.qml 2013-07-08 13:44:33 +0000 |
105 | +++ tests/unit/tst_components/tst_CrossFadeImage.qml 2013-10-14 08:32:19 +0000 |
106 | @@ -35,6 +35,15 @@ |
107 | target: crossFadeImage |
108 | } |
109 | |
110 | + CrossFadeImage { |
111 | + id: crossFadeImagePreset |
112 | + sourceSize { |
113 | + width: 123 |
114 | + height: 321 |
115 | + } |
116 | + source: Qt.resolvedUrl("../../../examples/ubuntu-ui-toolkit-gallery/demo_image.jpg") |
117 | + } |
118 | + |
119 | function loadImage(url) { |
120 | console.log("Loading image..."); |
121 | source = url; |
122 | @@ -93,4 +102,21 @@ |
123 | waitForAnimation(); |
124 | cleanupTest(); |
125 | } |
126 | + |
127 | + function test_sourceSize() { |
128 | + loadImage("../../../examples/ubuntu-ui-toolkit-gallery/demo_image.jpg"); |
129 | + compare(crossFadeImage.sourceSize.width, 640, "Source width incorrectly initialized."); |
130 | + compare(crossFadeImage.sourceSize.height, 427, "Source height incorrectly initialized."); |
131 | + crossFadeImage.sourceSize.width = 100; |
132 | + crossFadeImage.sourceSize.height = 101; |
133 | + compare(crossFadeImage.sourceSize.width, 100, "Source width incorrectly updated."); |
134 | + compare(crossFadeImage.sourceSize.height, 101, "Source height incorrectly updated."); |
135 | + waitForAnimation(); |
136 | + cleanupTest(); |
137 | + } |
138 | + |
139 | + function test_sourcePreset() { |
140 | + compare(crossFadeImagePreset.sourceSize.width, 123, "Source width incorrectly taken from preset."); |
141 | + compare(crossFadeImagePreset.sourceSize.height, 321, "Source height incorrectly take from preset."); |
142 | + } |
143 | } |
FAILED: Continuous integration, rev:764 jenkins. qa.ubuntu. com/job/ ubuntu- ui-toolkit- ci/748/ jenkins. qa.ubuntu. com/job/ generic- mediumtests- saucy-vm/ 67/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- touch/1568/ console jenkins. qa.ubuntu. com/job/ ubuntu- ui-toolkit- saucy-amd64- ci/605/ console jenkins. qa.ubuntu. com/job/ ubuntu- ui-toolkit- saucy-armhf- ci/605/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy-i386/ 4049/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy-armhf/ 1570/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins: 8080/job/ ubuntu- ui-toolkit- ci/748/ rebuild
http://