Merge lp:~aacid/unity8/moreAsyncDash into lp:unity8
- moreAsyncDash
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | MichaĆ Sawicz |
Approved revision: | 1402 |
Merged at revision: | 1506 |
Proposed branch: | lp:~aacid/unity8/moreAsyncDash |
Merge into: | lp:unity8 |
Prerequisite: | lp:~aacid/unity8/photoscopeimprovements |
Diff against target: |
413 lines (+102/-35) 16 files modified
plugins/Dash/abstractdashview.cpp (+24/-5) plugins/Dash/abstractdashview.h (+6/-0) plugins/Dash/listviewwithpageheader.cpp (+7/-2) plugins/Dash/listviewwithpageheader.h (+4/-4) qml/Components/ResponsiveVerticalJournal.qml (+1/-0) qml/Dash/CardGrid.qml (+1/-2) qml/Dash/CardVerticalJournal.qml (+1/-0) qml/Dash/DashContent.qml (+2/-0) qml/Dash/DashRenderer.qml (+2/-0) qml/Dash/GenericScopeView.qml (+45/-19) qml/Dash/ScopeListView.qml (+4/-2) tests/plugins/Dash/horizontaljournaltest.qml (+1/-0) tests/plugins/Dash/listviewwithpageheadertest.cpp (+1/-1) tests/plugins/Dash/organicgridtest.qml (+1/-0) tests/plugins/Dash/verticaljournaltest.qml (+1/-0) tests/qmltests/Dash/tst_GenericScopeView.qml (+1/-0) |
To merge this branch: | bzr merge lp:~aacid/unity8/moreAsyncDash |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andrea Cimitan (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Review via email: mp+241524@code.launchpad.net |
Commit message
Rework how we set the ranges so we get some more asynchronousity from item views
Description of the change
* Are there any related MPs required for this MP to build/function as expected?
prerequisite
* Did you perform an exploratory manual test run of your code change and any related functionality?
A few, still have to do more
* 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
PS Jenkins bot (ps-jenkins) wrote : | # |
- 1392. By Albert Astals Cid
- 1393. By Albert Astals Cid
-
Remove unused static
- 1394. By Albert Astals Cid
-
Set cache buffer to the value it had when the test was written
- 1395. By Albert Astals Cid
-
Repair the cachebuffer here too
- 1396. By Albert Astals Cid
-
Fix more tests
- 1397. By Albert Astals Cid
-
Make test pass
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1391
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1397
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1398. By Albert Astals Cid
-
Fix infinite loop in creation/deletion of delegates
There's two fixes actually:
* One fix the calculation of visibleRange
* Two make sure the displayMargins don't cross the wrong way (too much) otherwise GridView gets all confused and starts the infinite creation/destruction
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1398
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1399. By Albert Astals Cid
-
Merge photoscopeimpro
vements
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1399
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Andrea Cimitan (cimi) : | # |
Albert Astals Cid (aacid) : | # |
- 1400. By Albert Astals Cid
-
Make cacheBuffer int for consistency with Qt own's classes
- 1401. By Albert Astals Cid
-
Merge
- 1402. By Albert Astals Cid
-
Small fix after previous real -> int change
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1402
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Andrea Cimitan (cimi) 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.
Let's see if it kicks again soon
* Did you make sure that the branch does not contain spurious tags?
yes
waiting ci again to top approve
Preview Diff
1 | === modified file 'plugins/Dash/abstractdashview.cpp' | |||
2 | --- plugins/Dash/abstractdashview.cpp 2014-05-22 13:37:05 +0000 | |||
3 | +++ plugins/Dash/abstractdashview.cpp 2014-12-03 11:06:35 +0000 | |||
4 | @@ -16,13 +16,12 @@ | |||
5 | 16 | 16 | ||
6 | 17 | #include "abstractdashview.h" | 17 | #include "abstractdashview.h" |
7 | 18 | 18 | ||
8 | 19 | static const qreal bufferRatio = 0.5; | ||
9 | 20 | |||
10 | 21 | AbstractDashView::AbstractDashView() | 19 | AbstractDashView::AbstractDashView() |
11 | 22 | : m_delegateModel(nullptr) | 20 | : m_delegateModel(nullptr) |
12 | 23 | , m_asyncRequestedIndex(-1) | 21 | , m_asyncRequestedIndex(-1) |
13 | 24 | , m_columnSpacing(0) | 22 | , m_columnSpacing(0) |
14 | 25 | , m_rowSpacing(0) | 23 | , m_rowSpacing(0) |
15 | 24 | , m_buffer(320) // Same value used in qquickitemview.cpp in Qt 5.4 | ||
16 | 26 | , m_displayMarginBeginning(0) | 25 | , m_displayMarginBeginning(0) |
17 | 27 | , m_displayMarginEnd(0) | 26 | , m_displayMarginEnd(0) |
18 | 28 | , m_needsRelayout(false) | 27 | , m_needsRelayout(false) |
19 | @@ -112,6 +111,27 @@ | |||
20 | 112 | } | 111 | } |
21 | 113 | } | 112 | } |
22 | 114 | 113 | ||
23 | 114 | int AbstractDashView::cacheBuffer() const | ||
24 | 115 | { | ||
25 | 116 | return m_buffer; | ||
26 | 117 | } | ||
27 | 118 | |||
28 | 119 | void AbstractDashView::setCacheBuffer(int buffer) | ||
29 | 120 | { | ||
30 | 121 | if (buffer < 0) { | ||
31 | 122 | qmlInfo(this) << "Cannot set a negative cache buffer"; | ||
32 | 123 | return; | ||
33 | 124 | } | ||
34 | 125 | |||
35 | 126 | if (m_buffer != buffer) { | ||
36 | 127 | m_buffer = buffer; | ||
37 | 128 | if (isComponentComplete()) { | ||
38 | 129 | polish(); | ||
39 | 130 | } | ||
40 | 131 | emit cacheBufferChanged(); | ||
41 | 132 | } | ||
42 | 133 | } | ||
43 | 134 | |||
44 | 115 | qreal AbstractDashView::displayMarginBeginning() const | 135 | qreal AbstractDashView::displayMarginBeginning() const |
45 | 116 | { | 136 | { |
46 | 117 | return m_displayMarginBeginning; | 137 | return m_displayMarginBeginning; |
47 | @@ -160,9 +180,8 @@ | |||
48 | 160 | 180 | ||
49 | 161 | const qreal from = -m_displayMarginBeginning; | 181 | const qreal from = -m_displayMarginBeginning; |
50 | 162 | const qreal to = height() + m_displayMarginEnd; | 182 | const qreal to = height() + m_displayMarginEnd; |
54 | 163 | const qreal buffer = (to - from) * bufferRatio; | 183 | const qreal bufferFrom = from - m_buffer; |
55 | 164 | const qreal bufferFrom = from - buffer; | 184 | const qreal bufferTo = to + m_buffer; |
53 | 165 | const qreal bufferTo = to + buffer; | ||
56 | 166 | 185 | ||
57 | 167 | bool added = addVisibleItems(from, to, false); | 186 | bool added = addVisibleItems(from, to, false); |
58 | 168 | bool removed = removeNonVisibleItems(bufferFrom, bufferTo); | 187 | bool removed = removeNonVisibleItems(bufferFrom, bufferTo); |
59 | 169 | 188 | ||
60 | === modified file 'plugins/Dash/abstractdashview.h' | |||
61 | --- plugins/Dash/abstractdashview.h 2014-11-26 10:09:06 +0000 | |||
62 | +++ plugins/Dash/abstractdashview.h 2014-12-03 11:06:35 +0000 | |||
63 | @@ -35,6 +35,7 @@ | |||
64 | 35 | Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) | 35 | Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) |
65 | 36 | Q_PROPERTY(qreal columnSpacing READ columnSpacing WRITE setColumnSpacing NOTIFY columnSpacingChanged) | 36 | Q_PROPERTY(qreal columnSpacing READ columnSpacing WRITE setColumnSpacing NOTIFY columnSpacingChanged) |
66 | 37 | Q_PROPERTY(qreal rowSpacing READ rowSpacing WRITE setRowSpacing NOTIFY rowSpacingChanged) | 37 | Q_PROPERTY(qreal rowSpacing READ rowSpacing WRITE setRowSpacing NOTIFY rowSpacingChanged) |
67 | 38 | Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer NOTIFY cacheBufferChanged) | ||
68 | 38 | Q_PROPERTY(qreal displayMarginBeginning READ displayMarginBeginning | 39 | Q_PROPERTY(qreal displayMarginBeginning READ displayMarginBeginning |
69 | 39 | WRITE setDisplayMarginBeginning | 40 | WRITE setDisplayMarginBeginning |
70 | 40 | NOTIFY displayMarginBeginningChanged) | 41 | NOTIFY displayMarginBeginningChanged) |
71 | @@ -61,6 +62,9 @@ | |||
72 | 61 | qreal rowSpacing() const; | 62 | qreal rowSpacing() const; |
73 | 62 | void setRowSpacing(qreal rowSpacing); | 63 | void setRowSpacing(qreal rowSpacing); |
74 | 63 | 64 | ||
75 | 65 | int cacheBuffer() const; | ||
76 | 66 | void setCacheBuffer(int); | ||
77 | 67 | |||
78 | 64 | qreal displayMarginBeginning() const; | 68 | qreal displayMarginBeginning() const; |
79 | 65 | void setDisplayMarginBeginning(qreal); | 69 | void setDisplayMarginBeginning(qreal); |
80 | 66 | 70 | ||
81 | @@ -72,6 +76,7 @@ | |||
82 | 72 | void delegateChanged(); | 76 | void delegateChanged(); |
83 | 73 | void columnSpacingChanged(); | 77 | void columnSpacingChanged(); |
84 | 74 | void rowSpacingChanged(); | 78 | void rowSpacingChanged(); |
85 | 79 | void cacheBufferChanged(); | ||
86 | 75 | void displayMarginBeginningChanged(); | 80 | void displayMarginBeginningChanged(); |
87 | 76 | void displayMarginEndChanged(); | 81 | void displayMarginEndChanged(); |
88 | 77 | 82 | ||
89 | @@ -117,6 +122,7 @@ | |||
90 | 117 | 122 | ||
91 | 118 | int m_columnSpacing; | 123 | int m_columnSpacing; |
92 | 119 | int m_rowSpacing; | 124 | int m_rowSpacing; |
93 | 125 | int m_buffer; | ||
94 | 120 | qreal m_displayMarginBeginning; | 126 | qreal m_displayMarginBeginning; |
95 | 121 | qreal m_displayMarginEnd; | 127 | qreal m_displayMarginEnd; |
96 | 122 | bool m_needsRelayout; | 128 | bool m_needsRelayout; |
97 | 123 | 129 | ||
98 | === modified file 'plugins/Dash/listviewwithpageheader.cpp' | |||
99 | --- plugins/Dash/listviewwithpageheader.cpp 2014-11-26 10:09:06 +0000 | |||
100 | +++ plugins/Dash/listviewwithpageheader.cpp 2014-12-03 11:06:35 +0000 | |||
101 | @@ -334,13 +334,18 @@ | |||
102 | 334 | return m_headerItemShownHeight; | 334 | return m_headerItemShownHeight; |
103 | 335 | } | 335 | } |
104 | 336 | 336 | ||
106 | 337 | qreal ListViewWithPageHeader::cacheBuffer() const | 337 | int ListViewWithPageHeader::cacheBuffer() const |
107 | 338 | { | 338 | { |
108 | 339 | return m_cacheBuffer; | 339 | return m_cacheBuffer; |
109 | 340 | } | 340 | } |
110 | 341 | 341 | ||
112 | 342 | void ListViewWithPageHeader::setCacheBuffer(qreal cacheBuffer) | 342 | void ListViewWithPageHeader::setCacheBuffer(int cacheBuffer) |
113 | 343 | { | 343 | { |
114 | 344 | if (cacheBuffer < 0) { | ||
115 | 345 | qmlInfo(this) << "Cannot set a negative cache buffer"; | ||
116 | 346 | return; | ||
117 | 347 | } | ||
118 | 348 | |||
119 | 344 | if (cacheBuffer != m_cacheBuffer) { | 349 | if (cacheBuffer != m_cacheBuffer) { |
120 | 345 | m_cacheBuffer = cacheBuffer; | 350 | m_cacheBuffer = cacheBuffer; |
121 | 346 | Q_EMIT cacheBufferChanged(); | 351 | Q_EMIT cacheBufferChanged(); |
122 | 347 | 352 | ||
123 | === modified file 'plugins/Dash/listviewwithpageheader.h' | |||
124 | --- plugins/Dash/listviewwithpageheader.h 2014-10-10 11:13:26 +0000 | |||
125 | +++ plugins/Dash/listviewwithpageheader.h 2014-12-03 11:06:35 +0000 | |||
126 | @@ -54,7 +54,7 @@ | |||
127 | 54 | Q_PROPERTY(bool forceNoClip READ forceNoClip WRITE setForceNoClip NOTIFY forceNoClipChanged) | 54 | Q_PROPERTY(bool forceNoClip READ forceNoClip WRITE setForceNoClip NOTIFY forceNoClipChanged) |
128 | 55 | Q_PROPERTY(int stickyHeaderHeight READ stickyHeaderHeight NOTIFY stickyHeaderHeightChanged) | 55 | Q_PROPERTY(int stickyHeaderHeight READ stickyHeaderHeight NOTIFY stickyHeaderHeightChanged) |
129 | 56 | Q_PROPERTY(qreal headerItemShownHeight READ headerItemShownHeight NOTIFY headerItemShownHeightChanged) | 56 | Q_PROPERTY(qreal headerItemShownHeight READ headerItemShownHeight NOTIFY headerItemShownHeightChanged) |
131 | 57 | Q_PROPERTY(qreal cacheBuffer READ cacheBuffer WRITE setCacheBuffer NOTIFY cacheBufferChanged) | 57 | Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer NOTIFY cacheBufferChanged) |
132 | 58 | 58 | ||
133 | 59 | friend class ListViewWithPageHeaderTest; | 59 | friend class ListViewWithPageHeaderTest; |
134 | 60 | friend class ListViewWithPageHeaderTestSection; | 60 | friend class ListViewWithPageHeaderTestSection; |
135 | @@ -85,8 +85,8 @@ | |||
136 | 85 | int stickyHeaderHeight() const; | 85 | int stickyHeaderHeight() const; |
137 | 86 | qreal headerItemShownHeight() const; | 86 | qreal headerItemShownHeight() const; |
138 | 87 | 87 | ||
141 | 88 | qreal cacheBuffer() const; | 88 | int cacheBuffer() const; |
142 | 89 | void setCacheBuffer(qreal cacheBuffer); | 89 | void setCacheBuffer(int cacheBuffer); |
143 | 90 | 90 | ||
144 | 91 | Q_INVOKABLE void positionAtBeginning(); | 91 | Q_INVOKABLE void positionAtBeginning(); |
145 | 92 | Q_INVOKABLE void showHeader(); | 92 | Q_INVOKABLE void showHeader(); |
146 | @@ -204,7 +204,7 @@ | |||
147 | 204 | bool m_forceNoClip; | 204 | bool m_forceNoClip; |
148 | 205 | bool m_inLayout; | 205 | bool m_inLayout; |
149 | 206 | bool m_inContentHeightKeepHeaderShown; | 206 | bool m_inContentHeightKeepHeaderShown; |
151 | 207 | qreal m_cacheBuffer; | 207 | int m_cacheBuffer; |
152 | 208 | 208 | ||
153 | 209 | // Qt 5.0 doesn't like releasing the items just after itemCreated | 209 | // Qt 5.0 doesn't like releasing the items just after itemCreated |
154 | 210 | // so we delay the releasing until the next updatePolish | 210 | // so we delay the releasing until the next updatePolish |
155 | 211 | 211 | ||
156 | === modified file 'qml/Components/ResponsiveVerticalJournal.qml' | |||
157 | --- qml/Components/ResponsiveVerticalJournal.qml 2014-10-02 11:08:26 +0000 | |||
158 | +++ qml/Components/ResponsiveVerticalJournal.qml 2014-12-03 11:06:35 +0000 | |||
159 | @@ -45,6 +45,7 @@ | |||
160 | 45 | property alias rowSpacing: verticalJournalView.rowSpacing | 45 | property alias rowSpacing: verticalJournalView.rowSpacing |
161 | 46 | property alias model: verticalJournalView.model | 46 | property alias model: verticalJournalView.model |
162 | 47 | property alias delegate: verticalJournalView.delegate | 47 | property alias delegate: verticalJournalView.delegate |
163 | 48 | property alias cacheBuffer: verticalJournalView.cacheBuffer | ||
164 | 48 | property alias displayMarginBeginning: verticalJournalView.displayMarginBeginning | 49 | property alias displayMarginBeginning: verticalJournalView.displayMarginBeginning |
165 | 49 | property alias displayMarginEnd: verticalJournalView.displayMarginEnd | 50 | property alias displayMarginEnd: verticalJournalView.displayMarginEnd |
166 | 50 | 51 | ||
167 | 51 | 52 | ||
168 | === modified file 'qml/Dash/CardGrid.qml' | |||
169 | --- qml/Dash/CardGrid.qml 2014-10-30 09:13:09 +0000 | |||
170 | +++ qml/Dash/CardGrid.qml 2014-12-03 11:06:35 +0000 | |||
171 | @@ -50,7 +50,7 @@ | |||
172 | 50 | model: root.model | 50 | model: root.model |
173 | 51 | displayMarginBeginning: root.displayMarginBeginning | 51 | displayMarginBeginning: root.displayMarginBeginning |
174 | 52 | displayMarginEnd: root.displayMarginEnd | 52 | displayMarginEnd: root.displayMarginEnd |
176 | 53 | cacheBuffer: 0 | 53 | cacheBuffer: root.cacheBuffer |
177 | 54 | interactive: false | 54 | interactive: false |
178 | 55 | delegate: Item { | 55 | delegate: Item { |
179 | 56 | width: grid.cellWidth | 56 | width: grid.cellWidth |
180 | @@ -59,7 +59,6 @@ | |||
181 | 59 | id: loader | 59 | id: loader |
182 | 60 | sourceComponent: cardTool.cardComponent | 60 | sourceComponent: cardTool.cardComponent |
183 | 61 | anchors.horizontalCenter: parent.horizontalCenter | 61 | anchors.horizontalCenter: parent.horizontalCenter |
184 | 62 | asynchronous: true | ||
185 | 63 | onLoaded: { | 62 | onLoaded: { |
186 | 64 | item.objectName = "delegate" + index; | 63 | item.objectName = "delegate" + index; |
187 | 65 | item.width = Qt.binding(function() { return cardTool.cardWidth; }); | 64 | item.width = Qt.binding(function() { return cardTool.cardWidth; }); |
188 | 66 | 65 | ||
189 | === modified file 'qml/Dash/CardVerticalJournal.qml' | |||
190 | --- qml/Dash/CardVerticalJournal.qml 2014-11-05 15:06:42 +0000 | |||
191 | +++ qml/Dash/CardVerticalJournal.qml 2014-12-03 11:06:35 +0000 | |||
192 | @@ -59,6 +59,7 @@ | |||
193 | 59 | rowSpacing: minimumColumnSpacing | 59 | rowSpacing: minimumColumnSpacing |
194 | 60 | columnWidth: cardTool.cardWidth | 60 | columnWidth: cardTool.cardWidth |
195 | 61 | 61 | ||
196 | 62 | cacheBuffer: root.cacheBuffer | ||
197 | 62 | displayMarginBeginning: root.displayMarginBeginning | 63 | displayMarginBeginning: root.displayMarginBeginning |
198 | 63 | displayMarginEnd: root.displayMarginEnd | 64 | displayMarginEnd: root.displayMarginEnd |
199 | 64 | 65 | ||
200 | 65 | 66 | ||
201 | === modified file 'qml/Dash/DashContent.qml' | |||
202 | --- qml/Dash/DashContent.qml 2014-10-30 21:43:18 +0000 | |||
203 | +++ qml/Dash/DashContent.qml 2014-12-03 11:06:35 +0000 | |||
204 | @@ -153,6 +153,7 @@ | |||
205 | 153 | 153 | ||
206 | 154 | delegate: | 154 | delegate: |
207 | 155 | Loader { | 155 | Loader { |
208 | 156 | id: loader | ||
209 | 156 | width: ListView.view.width | 157 | width: ListView.view.width |
210 | 157 | height: ListView.view.height | 158 | height: ListView.view.height |
211 | 158 | opacity: { // hide delegate if offscreen | 159 | opacity: { // hide delegate if offscreen |
212 | @@ -181,6 +182,7 @@ | |||
213 | 181 | dashContent.scopeLoaded(item.scope.id) | 182 | dashContent.scopeLoaded(item.scope.id) |
214 | 182 | item.paginationCount = Qt.binding(function() { return dashContentList.count } ) | 183 | item.paginationCount = Qt.binding(function() { return dashContentList.count } ) |
215 | 183 | item.paginationIndex = Qt.binding(function() { return dashContentList.currentIndex } ) | 184 | item.paginationIndex = Qt.binding(function() { return dashContentList.currentIndex } ) |
216 | 185 | item.visibleToParent = Qt.binding(function() { return loader.opacity != 0 }); | ||
217 | 184 | item.holdingList = dashContentList; | 186 | item.holdingList = dashContentList; |
218 | 185 | item.forceNonInteractive = Qt.binding(function() { return dashContent.forceNonInteractive } ) | 187 | item.forceNonInteractive = Qt.binding(function() { return dashContent.forceNonInteractive } ) |
219 | 186 | } | 188 | } |
220 | 187 | 189 | ||
221 | === modified file 'qml/Dash/DashRenderer.qml' | |||
222 | --- qml/Dash/DashRenderer.qml 2014-10-28 09:32:48 +0000 | |||
223 | +++ qml/Dash/DashRenderer.qml 2014-12-03 11:06:35 +0000 | |||
224 | @@ -23,6 +23,8 @@ | |||
225 | 23 | 23 | ||
226 | 24 | property int collapsedItemCount: -1 | 24 | property int collapsedItemCount: -1 |
227 | 25 | 25 | ||
228 | 26 | property int cacheBuffer: 0 | ||
229 | 27 | |||
230 | 26 | property int displayMarginBeginning: 0 | 28 | property int displayMarginBeginning: 0 |
231 | 27 | 29 | ||
232 | 28 | property int displayMarginEnd: 0 | 30 | property int displayMarginEnd: 0 |
233 | 29 | 31 | ||
234 | === modified file 'qml/Dash/GenericScopeView.qml' | |||
235 | --- qml/Dash/GenericScopeView.qml 2014-11-06 15:25:51 +0000 | |||
236 | +++ qml/Dash/GenericScopeView.qml 2014-12-03 11:06:35 +0000 | |||
237 | @@ -38,6 +38,7 @@ | |||
238 | 38 | readonly property alias subPageShown: subPageLoader.subPageShown | 38 | readonly property alias subPageShown: subPageLoader.subPageShown |
239 | 39 | property int paginationCount: 0 | 39 | property int paginationCount: 0 |
240 | 40 | property int paginationIndex: 0 | 40 | property int paginationIndex: 0 |
241 | 41 | property bool visibleToParent: false | ||
242 | 41 | property alias pageHeaderTotallyVisible: categoryView.pageHeaderTotallyVisible | 42 | property alias pageHeaderTotallyVisible: categoryView.pageHeaderTotallyVisible |
243 | 42 | property var holdingList: null | 43 | property var holdingList: null |
244 | 43 | 44 | ||
245 | @@ -357,6 +358,7 @@ | |||
246 | 357 | Connections { | 358 | Connections { |
247 | 358 | target: scopeView | 359 | target: scopeView |
248 | 359 | onIsCurrentChanged: rendererLoader.updateRanges(); | 360 | onIsCurrentChanged: rendererLoader.updateRanges(); |
249 | 361 | onVisibleToParentChanged: rendererLoader.updateRanges(); | ||
250 | 360 | } | 362 | } |
251 | 361 | Connections { | 363 | Connections { |
252 | 362 | target: holdingList | 364 | target: holdingList |
253 | @@ -364,7 +366,9 @@ | |||
254 | 364 | } | 366 | } |
255 | 365 | 367 | ||
256 | 366 | function updateRanges() { | 368 | function updateRanges() { |
258 | 367 | if (holdingList && holdingList.moving) { | 369 | // Don't want to create stress by requesting more items during scope |
259 | 370 | // changes so unless you're not part of the visible scopes just return | ||
260 | 371 | if (holdingList && holdingList.moving && !scopeView.visibleToParent) { | ||
261 | 368 | return; | 372 | return; |
262 | 369 | } | 373 | } |
263 | 370 | 374 | ||
264 | @@ -380,28 +384,50 @@ | |||
265 | 380 | } | 384 | } |
266 | 381 | 385 | ||
267 | 382 | if (item && item.hasOwnProperty("displayMarginBeginning")) { | 386 | if (item && item.hasOwnProperty("displayMarginBeginning")) { |
269 | 383 | // A item view is considered visible from | 387 | // A item view creates its delegates synchronously from |
270 | 384 | // -displayMarginBeginning | 388 | // -displayMarginBeginning |
271 | 385 | // to | 389 | // to |
273 | 386 | // height + item.displayMarginEnd | 390 | // height + displayMarginEnd |
274 | 391 | // Around that area it adds the cacheBuffer area where delegates are created async | ||
275 | 392 | // | ||
276 | 387 | // We adjust displayMarginBeginning and displayMarginEnd so | 393 | // We adjust displayMarginBeginning and displayMarginEnd so |
281 | 388 | // * In non visible scopes only the viewport is considered visible | 394 | // * In non visible scopes nothing is considered visible and we set cacheBuffer |
282 | 389 | // that way when you switch to it the visible items are there | 395 | // so that creates the items that would be in the viewport asynchronously |
283 | 390 | // * For visible scopes we increase the visible range by categoryView.height * 1.5 | 396 | // * For the current scope set the visible range to the viewport and then |
284 | 391 | // in both directions to make scrolling nicer by mantaining a higher number of | 397 | // use cacheBuffer to create extra items for categoryView.height * 1.5 |
285 | 398 | // to make scrolling nicer by mantaining a higher number of | ||
286 | 392 | // cached items | 399 | // cached items |
299 | 393 | // TODO Improvements | 400 | // * For non current but visible scopes (i.e. when the user changes from one scope |
300 | 394 | // - For non visible scopes we should always have a visible range of 0 and | 401 | // to the next, we set the visible range to the viewport so |
301 | 395 | // make sure the items in the viewport are created with the cache buffer feature | 402 | // items are not culled (invisible) but still use no cacheBuffer |
302 | 396 | // - For visible scopes we should always the have a visible range be exactly the | 403 | // (it will be set once the scope is the current one) |
303 | 397 | // viewport and make sure the rest of items are created with the cache buffer feature | 404 | var displayMarginBeginning = baseItem.y; |
304 | 398 | // To be able to implement that feature VerticalJournal/AbstractDashView needs to | 405 | displayMarginBeginning = -Math.max(-displayMarginBeginning, 0); |
305 | 399 | // make the cache buffer value setable externally | 406 | displayMarginBeginning = -Math.min(-displayMarginBeginning, baseItem.height); |
306 | 400 | var extraMargins = scopeView.isCurrent ? categoryView.height * 1.5 : 0; | 407 | displayMarginBeginning = Math.round(displayMarginBeginning); |
307 | 401 | 408 | var displayMarginEnd = -baseItem.height + seeAll.height + categoryView.height - baseItem.y; | |
308 | 402 | item.displayMarginBeginning = Math.round(-Math.max(-baseItem.y - extraMargins, 0)); | 409 | displayMarginEnd = -Math.max(-displayMarginEnd, 0); |
309 | 403 | item.displayMarginEnd = -Math.round(Math.max(baseItem.height - extraMargins - seeAll.height - | 410 | displayMarginEnd = -Math.min(-displayMarginEnd, baseItem.height); |
310 | 404 | categoryView.height + baseItem.y, 0)); | 411 | displayMarginEnd = Math.round(displayMarginEnd); |
311 | 412 | if (scopeView.isCurrent || scopeView.visibleToParent) { | ||
312 | 413 | item.displayMarginBeginning = displayMarginBeginning; | ||
313 | 414 | item.displayMarginEnd = displayMarginEnd; | ||
314 | 415 | item.cacheBuffer = scopeView.isCurrent ? categoryView.height * 1.5 : 0; | ||
315 | 416 | } else { | ||
316 | 417 | var visibleRange = baseItem.height + displayMarginEnd + displayMarginBeginning; | ||
317 | 418 | if (visibleRange < 0) { | ||
318 | 419 | item.displayMarginBeginning = displayMarginBeginning; | ||
319 | 420 | item.displayMarginEnd = displayMarginEnd; | ||
320 | 421 | item.cacheBuffer = 0; | ||
321 | 422 | } else { | ||
322 | 423 | // This should be visibleRange/2 in each of the properties | ||
323 | 424 | // but some item views still (like GridView) like creating sync delegates even if | ||
324 | 425 | // the visible range is 0 so let's make sure the visible range is negative | ||
325 | 426 | item.displayMarginBeginning = displayMarginBeginning - visibleRange; | ||
326 | 427 | item.displayMarginEnd = displayMarginEnd - visibleRange; | ||
327 | 428 | item.cacheBuffer = visibleRange; | ||
328 | 429 | } | ||
329 | 430 | } | ||
330 | 405 | } | 431 | } |
331 | 406 | } | 432 | } |
332 | 407 | } | 433 | } |
333 | 408 | 434 | ||
334 | === modified file 'qml/Dash/ScopeListView.qml' | |||
335 | --- qml/Dash/ScopeListView.qml 2014-10-23 11:59:22 +0000 | |||
336 | +++ qml/Dash/ScopeListView.qml 2014-12-03 11:06:35 +0000 | |||
337 | @@ -1,5 +1,5 @@ | |||
338 | 1 | /* | 1 | /* |
340 | 2 | * Copyright (C) 2013 Canonical, Ltd. | 2 | * Copyright (C) 2014 Canonical, Ltd. |
341 | 3 | * | 3 | * |
342 | 4 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
343 | 5 | * it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by |
344 | @@ -20,5 +20,7 @@ | |||
345 | 20 | ListViewWithPageHeader { | 20 | ListViewWithPageHeader { |
346 | 21 | maximumFlickVelocity: height * 10 | 21 | maximumFlickVelocity: height * 10 |
347 | 22 | flickDeceleration: height * 2 | 22 | flickDeceleration: height * 2 |
349 | 23 | cacheBuffer: Number.MAX_VALUE | 23 | // 1073741823 is s^30 -1. A quite big number so that you have "infinite" cache, but not so |
350 | 24 | // big so that if you add if with itself you're outside the 2^31 int range | ||
351 | 25 | cacheBuffer: 1073741823 | ||
352 | 24 | } | 26 | } |
353 | 25 | 27 | ||
354 | === modified file 'tests/plugins/Dash/horizontaljournaltest.qml' | |||
355 | --- tests/plugins/Dash/horizontaljournaltest.qml 2014-04-30 10:06:33 +0000 | |||
356 | +++ tests/plugins/Dash/horizontaljournaltest.qml 2014-12-03 11:06:35 +0000 | |||
357 | @@ -25,6 +25,7 @@ | |||
358 | 25 | rowHeight: 150 | 25 | rowHeight: 150 |
359 | 26 | columnSpacing: 10 | 26 | columnSpacing: 10 |
360 | 27 | rowSpacing: 10 | 27 | rowSpacing: 10 |
361 | 28 | cacheBuffer: Math.max(0, (height + displayMarginEnd + displayMarginBeginning) / 2) | ||
362 | 28 | 29 | ||
363 | 29 | delegate: Rectangle { | 30 | delegate: Rectangle { |
364 | 30 | property real randomValue: Math.random() | 31 | property real randomValue: Math.random() |
365 | 31 | 32 | ||
366 | === modified file 'tests/plugins/Dash/listviewwithpageheadertest.cpp' | |||
367 | --- tests/plugins/Dash/listviewwithpageheadertest.cpp 2014-08-26 08:41:02 +0000 | |||
368 | +++ tests/plugins/Dash/listviewwithpageheadertest.cpp 2014-12-03 11:06:35 +0000 | |||
369 | @@ -1920,7 +1920,7 @@ | |||
370 | 1920 | 1920 | ||
371 | 1921 | void testAllCacheBuffer() | 1921 | void testAllCacheBuffer() |
372 | 1922 | { | 1922 | { |
374 | 1923 | lvwph->setCacheBuffer(std::numeric_limits<qreal>::max()); | 1923 | lvwph->setCacheBuffer(std::numeric_limits<int>::max()); |
375 | 1924 | QTRY_COMPARE(lvwph->m_visibleItems.count(), 6); | 1924 | QTRY_COMPARE(lvwph->m_visibleItems.count(), 6); |
376 | 1925 | QCOMPARE(lvwph->m_firstVisibleIndex, 0); | 1925 | QCOMPARE(lvwph->m_firstVisibleIndex, 0); |
377 | 1926 | verifyItem(0, 50., 150., false); | 1926 | verifyItem(0, 50., 150., false); |
378 | 1927 | 1927 | ||
379 | === modified file 'tests/plugins/Dash/organicgridtest.qml' | |||
380 | --- tests/plugins/Dash/organicgridtest.qml 2014-04-30 10:06:33 +0000 | |||
381 | +++ tests/plugins/Dash/organicgridtest.qml 2014-12-03 11:06:35 +0000 | |||
382 | @@ -27,6 +27,7 @@ | |||
383 | 27 | rowSpacing: 10 | 27 | rowSpacing: 10 |
384 | 28 | smallDelegateSize: Qt.size(90, 90) | 28 | smallDelegateSize: Qt.size(90, 90) |
385 | 29 | bigDelegateSize: Qt.size(180, 180) | 29 | bigDelegateSize: Qt.size(180, 180) |
386 | 30 | cacheBuffer: Math.max(0, (height + displayMarginEnd + displayMarginBeginning) / 2) | ||
387 | 30 | 31 | ||
388 | 31 | delegate: Rectangle { | 32 | delegate: Rectangle { |
389 | 32 | property real randomValue: Math.random() | 33 | property real randomValue: Math.random() |
390 | 33 | 34 | ||
391 | === modified file 'tests/plugins/Dash/verticaljournaltest.qml' | |||
392 | --- tests/plugins/Dash/verticaljournaltest.qml 2014-04-30 10:06:33 +0000 | |||
393 | +++ tests/plugins/Dash/verticaljournaltest.qml 2014-12-03 11:06:35 +0000 | |||
394 | @@ -26,6 +26,7 @@ | |||
395 | 26 | columnWidth: 150 | 26 | columnWidth: 150 |
396 | 27 | columnSpacing: 10 | 27 | columnSpacing: 10 |
397 | 28 | rowSpacing: 10 | 28 | rowSpacing: 10 |
398 | 29 | cacheBuffer: Math.max(0, (height + displayMarginEnd + displayMarginBeginning) / 2) | ||
399 | 29 | 30 | ||
400 | 30 | delegate: Rectangle { | 31 | delegate: Rectangle { |
401 | 31 | property real randomValue: Math.random() | 32 | property real randomValue: Math.random() |
402 | 32 | 33 | ||
403 | === modified file 'tests/qmltests/Dash/tst_GenericScopeView.qml' | |||
404 | --- tests/qmltests/Dash/tst_GenericScopeView.qml 2014-11-26 08:27:45 +0000 | |||
405 | +++ tests/qmltests/Dash/tst_GenericScopeView.qml 2014-12-03 11:06:35 +0000 | |||
406 | @@ -59,6 +59,7 @@ | |||
407 | 59 | GenericScopeView { | 59 | GenericScopeView { |
408 | 60 | id: genericScopeView | 60 | id: genericScopeView |
409 | 61 | anchors.fill: parent | 61 | anchors.fill: parent |
410 | 62 | visibleToParent: true | ||
411 | 62 | 63 | ||
412 | 63 | UT.UnityTestCase { | 64 | UT.UnityTestCase { |
413 | 64 | id: testCase | 65 | id: testCase |
FAILED: Continuous integration, rev:1391 jenkins. qa.ubuntu. com/job/ unity8- ci/4879/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- vivid-touch/ 143/console jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- vivid/56 jenkins. qa.ubuntu. com/job/ unity8- vivid-amd64- ci/44 jenkins. qa.ubuntu. com/job/ unity8- vivid-i386- ci/44 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- vivid-mako/ 136/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 143 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 143/artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 15733
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity8- ci/4879/ rebuild
http://