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

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michał Sawicz
Approved revision: 1394
Merged at revision: 1461
Proposed branch: lp:~aacid/unity8/photoscopeimprovements
Merge into: lp:unity8
Prerequisite: lp:~aacid/unity8/croppedImageSizer
Diff against target: 411 lines (+47/-80)
23 files modified
debian/control (+0/-1)
plugins/Dash/CardCreator.js (+2/-5)
plugins/Dash/CroppedImageMinimumSourceSize.qml (+1/-1)
plugins/Dash/croppedimagesizer.cpp (+3/-0)
plugins/Dash/croppedimagesizer.h (+3/-3)
qml/Dash/CardCarousel.qml (+1/-0)
qml/Dash/CardGrid.qml (+1/-1)
qml/Dash/CardHorizontalList.qml (+1/-0)
qml/Dash/CardVerticalJournal.qml (+0/-1)
qml/Dash/DashRenderer.qml (+0/-4)
qml/Dash/GenericScopeView.qml (+22/-25)
qml/Dash/Previews/PreviewZoomableImage.qml (+1/-0)
qml/Dash/ScopesOverviewAll.qml (+0/-2)
tests/autopilot/unity8/shell/emulators/dash.py (+1/-1)
tests/plugins/Dash/cardcreator/1.res (+1/-2)
tests/plugins/Dash/cardcreator/2.res (+1/-2)
tests/plugins/Dash/cardcreator/3.res (+1/-2)
tests/plugins/Dash/cardcreator/4.res (+1/-2)
tests/plugins/Dash/cardcreator/5.res (+1/-2)
tests/plugins/Dash/cardcreator/7.res (+1/-2)
tests/qmltests/Dash/tst_Card.qml (+0/-22)
tests/qmltests/Dash/tst_Dash.qml (+4/-2)
tests/qmltests/Dash/tst_GenericScopeView.qml (+1/-0)
To merge this branch: bzr merge lp:~aacid/unity8/photoscopeimprovements
Reviewer Review Type Date Requested Status
Michał Sawicz Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Andrea Cimitan (community) code Approve
Review via email: mp+239834@code.launchpad.net

Commit message

Don't create the whole current scope delegates, just height * 3

Description of the change

* Are there any related MPs required for this MP to build/function as expected?
https://code.launchpad.net/~saviq/ubuntu-system-settings/add-connectivity-dep/+merge/243273 - needs to land together, or before

 * 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.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

could you add asynchronous true in previewzoomableimage? other than that, photo scope improves for me

Revision history for this message
Albert Astals Cid (aacid) wrote :

> could you add asynchronous true in previewzoomableimage? other than that,
> photo scope improves for me

Done

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) :
review: Approve (code)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) :
review: Approve (code)
Revision history for this message
Andrea Cimitan (cimi) wrote :

I tested and I had other issues (dash activity indicator staying on screen for several seconds, and news scope with results on top of each other), they are likely unrelated to this. Waiting another silo to test again on RTM

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

This introduced a failure in AP:
unity8.shell.tests.test_emulators.GenericScopeViewEmulatorTestCase.test_open_preview

review: Needs Fixing
1394. By Albert Astals Cid

Need a wait_ here now that things are more async

Revision history for this message
Albert Astals Cid (aacid) wrote :

> This introduced a failure in AP:
> unity8.shell.tests.test_emulators.GenericScopeViewEmulatorTestCase.test_open_p
> review

Fixed with the last commit, running the test is considerably slower with this branch than with trunk (105 seconds vs 85 seconds) but using https://code.launchpad.net/~aacid/unity8/moreAsyncDash it goes back to 85 seconds so i think it should not be a problem.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control'
--- debian/control 2014-11-17 10:09:40 +0000
+++ debian/control 2014-12-01 15:53:18 +0000
@@ -173,7 +173,6 @@
173 libhardware2,173 libhardware2,
174 unity-schemas (>= 7.3.1+14.10.20140915),174 unity-schemas (>= 7.3.1+14.10.20140915),
175 pay-service,175 pay-service,
176 qml-module-ubuntu-connectivity,
177 ${misc:Depends},176 ${misc:Depends},
178 ${shlibs:Depends},177 ${shlibs:Depends},
179Provides: unity-launcher-impl,178Provides: unity-launcher-impl,
180179
=== modified file 'plugins/Dash/CardCreator.js'
--- plugins/Dash/CardCreator.js 2014-12-01 15:53:18 +0000
+++ plugins/Dash/CardCreator.js 2014-12-01 15:53:18 +0000
@@ -85,8 +85,7 @@
85 CroppedImageMinimumSourceSize { \n\85 CroppedImageMinimumSourceSize { \n\
86 id: artImage; \n\86 id: artImage; \n\
87 objectName: "artImage"; \n\87 objectName: "artImage"; \n\
88 property bool doLoadSource: !NetworkingStatus.limitedBandwith; \n\88 source: cardData && cardData["art"] || ""; \n\
89 source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["art"] || ""; } \n\
90 asynchronous: root.asynchronous; \n\89 asynchronous: root.asynchronous; \n\
91 visible: false; \n\90 visible: false; \n\
92 width: %2; \n\91 width: %2; \n\
@@ -196,8 +195,7 @@
196 id: mascotImage; \n\195 id: mascotImage; \n\
197 objectName: "mascotImage"; \n\196 objectName: "mascotImage"; \n\
198 anchors { %1 } \n\197 anchors { %1 } \n\
199 property bool doLoadSource: !NetworkingStatus.limitedBandwith; \n\198 source: cardData && cardData["mascot"] || ""; \n\
200 source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["mascot"] || ""; } \n\
201 width: units.gu(6); \n\199 width: units.gu(6); \n\
202 height: units.gu(5.625); \n\200 height: units.gu(5.625); \n\
203 horizontalAlignment: Image.AlignHCenter; \n\201 horizontalAlignment: Image.AlignHCenter; \n\
@@ -656,7 +654,6 @@
656 var imports = 'import QtQuick 2.2; \n\654 var imports = 'import QtQuick 2.2; \n\
657 import Ubuntu.Components 1.1; \n\655 import Ubuntu.Components 1.1; \n\
658 import Ubuntu.Settings.Components 0.1; \n\656 import Ubuntu.Settings.Components 0.1; \n\
659 import Ubuntu.Connectivity 1.0; \n\
660 import Dash 0.1;\n\657 import Dash 0.1;\n\
661 import Utils 0.1;\n';658 import Utils 0.1;\n';
662 var card = cardString(template, components);659 var card = cardString(template, components);
663660
=== modified file 'plugins/Dash/CroppedImageMinimumSourceSize.qml'
--- plugins/Dash/CroppedImageMinimumSourceSize.qml 2014-12-01 15:53:18 +0000
+++ plugins/Dash/CroppedImageMinimumSourceSize.qml 2014-12-01 15:53:18 +0000
@@ -39,6 +39,6 @@
39 anchors.fill: parent39 anchors.fill: parent
40 fillMode: Image.PreserveAspectCrop40 fillMode: Image.PreserveAspectCrop
41 sourceSize: sizer.sourceSize.width == 0 && sizer.sourceSize.height == 0 ? undefined : sizer.sourceSize41 sourceSize: sizer.sourceSize.width == 0 && sizer.sourceSize.height == 0 ? undefined : sizer.sourceSize
42 source: sourceSize.width == -1 && sourceSize.height == -1 ? "" : root.source42 source: sizer.sourceSize.width == -1 && sizer.sourceSize.height == -1 ? "" : root.source
43 }43 }
44}44}
4545
=== modified file 'plugins/Dash/croppedimagesizer.cpp'
--- plugins/Dash/croppedimagesizer.cpp 2014-12-01 15:53:18 +0000
+++ plugins/Dash/croppedimagesizer.cpp 2014-12-01 15:53:18 +0000
@@ -24,6 +24,9 @@
24#include <QQuickView>24#include <QQuickView>
2525
26CroppedImageSizer::CroppedImageSizer()26CroppedImageSizer::CroppedImageSizer()
27 : m_width(0),
28 m_height(0),
29 m_sourceSize(QSize(-1, -1))
27{30{
28 connect(this, &CroppedImageSizer::inputParamsChanged, this, &CroppedImageSizer::calculateSourceSize);31 connect(this, &CroppedImageSizer::inputParamsChanged, this, &CroppedImageSizer::calculateSourceSize);
29 connect(this, &CroppedImageSizer::sourceChanged, this, &CroppedImageSizer::requestImage);32 connect(this, &CroppedImageSizer::sourceChanged, this, &CroppedImageSizer::requestImage);
3033
=== modified file 'plugins/Dash/croppedimagesizer.h'
--- plugins/Dash/croppedimagesizer.h 2014-12-01 15:53:18 +0000
+++ plugins/Dash/croppedimagesizer.h 2014-12-01 15:53:18 +0000
@@ -61,9 +61,9 @@
6161
62private:62private:
63 QUrl m_source;63 QUrl m_source;
64 qreal m_width = 0;64 qreal m_width;
65 qreal m_height = 0;65 qreal m_height;
66 QSize m_sourceSize = QSize(-1, -1);66 QSize m_sourceSize;
67 QSize m_imageSize;67 QSize m_imageSize;
68 QNetworkReply *m_reply = nullptr;68 QNetworkReply *m_reply = nullptr;
69};69};
7070
=== modified file 'qml/Dash/CardCarousel.qml'
--- qml/Dash/CardCarousel.qml 2014-09-12 09:31:56 +0000
+++ qml/Dash/CardCarousel.qml 2014-12-01 15:53:18 +0000
@@ -52,6 +52,7 @@
52 function pressAndHold() { cardCarousel.pressAndHold(index, model.result, model) }52 function pressAndHold() { cardCarousel.pressAndHold(index, model.result, model) }
5353
54 sourceComponent: cardTool.cardComponent54 sourceComponent: cardTool.cardComponent
55 asynchronous: true
55 onLoaded: {56 onLoaded: {
56 item.fixedHeaderHeight = Qt.binding(function() { return carousel.headerHeight; });57 item.fixedHeaderHeight = Qt.binding(function() { return carousel.headerHeight; });
57 item.height = Qt.binding(function() { return cardTool.cardHeight; });58 item.height = Qt.binding(function() { return cardTool.cardHeight; });
5859
=== modified file 'qml/Dash/CardGrid.qml'
--- qml/Dash/CardGrid.qml 2014-09-30 09:23:23 +0000
+++ qml/Dash/CardGrid.qml 2014-12-01 15:53:18 +0000
@@ -55,11 +55,11 @@
55 delegate: Item {55 delegate: Item {
56 width: grid.cellWidth56 width: grid.cellWidth
57 height: grid.cellHeight57 height: grid.cellHeight
58 visible: y + height >= root.visibleRangeBegin && y <= root.visibleRangeEnd
59 Loader {58 Loader {
60 id: loader59 id: loader
61 sourceComponent: cardTool.cardComponent60 sourceComponent: cardTool.cardComponent
62 anchors.horizontalCenter: parent.horizontalCenter61 anchors.horizontalCenter: parent.horizontalCenter
62 asynchronous: true
63 onLoaded: {63 onLoaded: {
64 item.objectName = "delegate" + index;64 item.objectName = "delegate" + index;
65 item.width = Qt.binding(function() { return cardTool.cardWidth; });65 item.width = Qt.binding(function() { return cardTool.cardWidth; });
6666
=== modified file 'qml/Dash/CardHorizontalList.qml'
--- qml/Dash/CardHorizontalList.qml 2014-10-23 11:59:22 +0000
+++ qml/Dash/CardHorizontalList.qml 2014-12-01 15:53:18 +0000
@@ -42,6 +42,7 @@
42 sourceComponent: cardTool.cardComponent42 sourceComponent: cardTool.cardComponent
43 anchors { top: parent.top; bottom: parent.bottom }43 anchors { top: parent.top; bottom: parent.bottom }
44 width: cardTool.cardWidth44 width: cardTool.cardWidth
45 asynchronous: true
45 onLoaded: {46 onLoaded: {
46 item.objectName = "delegate" + index;47 item.objectName = "delegate" + index;
47 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });48 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
4849
=== modified file 'qml/Dash/CardVerticalJournal.qml'
--- qml/Dash/CardVerticalJournal.qml 2014-10-15 15:03:51 +0000
+++ qml/Dash/CardVerticalJournal.qml 2014-12-01 15:53:18 +0000
@@ -66,7 +66,6 @@
66 id: loader66 id: loader
67 sourceComponent: cardTool.cardComponent67 sourceComponent: cardTool.cardComponent
68 width: cardTool.cardWidth68 width: cardTool.cardWidth
69 visible: y + height >= root.visibleRangeBegin && y <= root.visibleRangeEnd
70 onLoaded: {69 onLoaded: {
71 item.objectName = "delegate" + index;70 item.objectName = "delegate" + index;
72 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });71 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
7372
=== modified file 'qml/Dash/DashRenderer.qml'
--- qml/Dash/DashRenderer.qml 2014-10-02 09:53:26 +0000
+++ qml/Dash/DashRenderer.qml 2014-12-01 15:53:18 +0000
@@ -27,10 +27,6 @@
2727
28 property int displayMarginEnd: 028 property int displayMarginEnd: 0
2929
30 property int visibleRangeBegin: 0
31
32 property int visibleRangeEnd: 0
33
34 property real originY: 030 property real originY: 0
3531
36 // The model to renderer32 // The model to renderer
3733
=== modified file 'qml/Dash/GenericScopeView.qml'
--- qml/Dash/GenericScopeView.qml 2014-11-04 12:52:02 +0000
+++ qml/Dash/GenericScopeView.qml 2014-12-01 15:53:18 +0000
@@ -379,32 +379,29 @@
379 }379 }
380 }380 }
381381
382 if (item && item.hasOwnProperty("visibleRangeBegin")) {
383 item.visibleRangeBegin = Math.max(-baseItem.y, 0)
384 item.visibleRangeEnd = item.visibleRangeBegin + Math.min(categoryView.height, rendererLoader.height)
385 }
386
387 if (item && item.hasOwnProperty("displayMarginBeginning")) {382 if (item && item.hasOwnProperty("displayMarginBeginning")) {
388 // TODO do we need item.originY here, test 1300302 once we have a silo383 // A item view is considered visible from
389 // and we can run it on the phone384 // -displayMarginBeginning
390 if (scopeView.isCurrent) {385 // to
391 // 1073741823 is s^30 -1. A quite big number so that you have "infinite" display margin, but not so386 // height + item.displayMarginEnd
392 // big so that if you add if with itself you're outside the 2^31 int range387 // We adjust displayMarginBeginning and displayMarginEnd so
393 item.displayMarginBeginning = 1073741823;388 // * In non visible scopes only the viewport is considered visible
394 item.displayMarginEnd = 1073741823;389 // that way when you switch to it the visible items are there
395 } else if (baseItem.y + baseItem.height <= 0) {390 // * For visible scopes we increase the visible range by categoryView.height * 1.5
396 // Not visible (item at top of the list viewport)391 // in both directions to make scrolling nicer by mantaining a higher number of
397 item.displayMarginBeginning = -baseItem.height;392 // cached items
398 item.displayMarginEnd = 0;393 // TODO Improvements
399 } else if (baseItem.y >= categoryView.height) {394 // - For non visible scopes we should always have a visible range of 0 and
400 // Not visible (item at bottom of the list viewport)395 // make sure the items in the viewport are created with the cache buffer feature
401 item.displayMarginBeginning = 0;396 // - For visible scopes we should always the have a visible range be exactly the
402 item.displayMarginEnd = -baseItem.height;397 // viewport and make sure the rest of items are created with the cache buffer feature
403 } else {398 // To be able to implement that feature VerticalJournal/AbstractDashView needs to
404 item.displayMarginBeginning = Math.round(-Math.max(-baseItem.y, 0));399 // make the cache buffer value setable externally
405 item.displayMarginEnd = -Math.round(Math.max(baseItem.height - seeAll.height -400 var extraMargins = scopeView.isCurrent ? categoryView.height * 1.5 : 0;
406 categoryView.height + baseItem.y, 0));401
407 }402 item.displayMarginBeginning = Math.round(-Math.max(-baseItem.y - extraMargins, 0));
403 item.displayMarginEnd = -Math.round(Math.max(baseItem.height - extraMargins - seeAll.height -
404 categoryView.height + baseItem.y, 0));
408 }405 }
409 }406 }
410 }407 }
411408
=== modified file 'qml/Dash/Previews/PreviewZoomableImage.qml'
--- qml/Dash/Previews/PreviewZoomableImage.qml 2014-10-22 17:35:15 +0000
+++ qml/Dash/Previews/PreviewZoomableImage.qml 2014-12-01 15:53:18 +0000
@@ -40,6 +40,7 @@
40 }40 }
41 scaleTo: "height"41 scaleTo: "height"
42 source: widgetData["source"]42 source: widgetData["source"]
43 asynchronous: true
4344
44 borderSource: mouseArea.pressed ? "radius_pressed.sci" : "radius_idle.sci"45 borderSource: mouseArea.pressed ? "radius_pressed.sci" : "radius_idle.sci"
4546
4647
=== modified file 'qml/Dash/ScopesOverviewAll.qml'
--- qml/Dash/ScopesOverviewAll.qml 2014-10-23 11:59:22 +0000
+++ qml/Dash/ScopesOverviewAll.qml 2014-12-01 15:53:18 +0000
@@ -43,8 +43,6 @@
43 id: cardGrid43 id: cardGrid
44 width: root.width44 width: root.width
45 height: parent.height45 height: parent.height
46 visibleRangeBegin: root.contentY
47 visibleRangeEnd: root.contentY + root.height
4846
49 onClicked: {47 onClicked: {
50 root.clicked(index, result, item, itemModel);48 root.clicked(index, result, item, itemModel);
5149
=== renamed file 'qml/graphics/applicationIcons/dash@18.png' => 'qml/graphics/applicationIcons/dash.png'
=== modified file 'tests/autopilot/unity8/shell/emulators/dash.py'
--- tests/autopilot/unity8/shell/emulators/dash.py 2014-10-30 14:38:28 +0000
+++ tests/autopilot/unity8/shell/emulators/dash.py 2014-12-01 15:53:18 +0000
@@ -204,7 +204,7 @@
204204
205 """205 """
206 category_element = self._get_category_element(category)206 category_element = self._get_category_element(category)
207 icon = category_element.select_single('AbstractButton', title=title)207 icon = category_element.wait_select_single('AbstractButton', title=title)
208 self.pointing_device.click_object(icon)208 self.pointing_device.click_object(icon)
209209
210 def _get_category_element(self, category):210 def _get_category_element(self, category):
211211
=== modified file 'tests/plugins/Dash/cardcreator/1.res'
--- tests/plugins/Dash/cardcreator/1.res 2014-12-01 15:53:18 +0000
+++ tests/plugins/Dash/cardcreator/1.res 2014-12-01 15:53:18 +0000
@@ -49,8 +49,7 @@
49 CroppedImageMinimumSourceSize {49 CroppedImageMinimumSourceSize {
50 id: artImage;50 id: artImage;
51 objectName: "artImage"; 51 objectName: "artImage";
52 property bool doLoadSource: !NetworkingStatus.limitedBandwith;52 source: cardData && cardData["art"] || "";
53 source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["art"] || ""; }
54 asynchronous: root.asynchronous; 53 asynchronous: root.asynchronous;
55 visible: false; 54 visible: false;
56 width: root.width; 55 width: root.width;
5756
=== modified file 'tests/plugins/Dash/cardcreator/2.res'
--- tests/plugins/Dash/cardcreator/2.res 2014-12-01 15:53:18 +0000
+++ tests/plugins/Dash/cardcreator/2.res 2014-12-01 15:53:18 +0000
@@ -68,8 +68,7 @@
68 id: mascotImage; 68 id: mascotImage;
69 objectName: "mascotImage"; 69 objectName: "mascotImage";
70 anchors { verticalCenter: parent.verticalCenter; } 70 anchors { verticalCenter: parent.verticalCenter; }
71 property bool doLoadSource: !NetworkingStatus.limitedBandwith;71 source: cardData && cardData["mascot"] || "";
72 source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["mascot"] || ""; }
73 width: units.gu(6); 72 width: units.gu(6);
74 height: units.gu(5.625); 73 height: units.gu(5.625);
75 horizontalAlignment: Image.AlignHCenter; 74 horizontalAlignment: Image.AlignHCenter;
7675
=== modified file 'tests/plugins/Dash/cardcreator/3.res'
--- tests/plugins/Dash/cardcreator/3.res 2014-12-01 15:53:18 +0000
+++ tests/plugins/Dash/cardcreator/3.res 2014-12-01 15:53:18 +0000
@@ -49,8 +49,7 @@
49 CroppedImageMinimumSourceSize {49 CroppedImageMinimumSourceSize {
50 id: artImage;50 id: artImage;
51 objectName: "artImage";51 objectName: "artImage";
52 property bool doLoadSource: !NetworkingStatus.limitedBandwith;52 source: cardData && cardData["art"] || "";
53 source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["art"] || ""; }
54 asynchronous: root.asynchronous;53 asynchronous: root.asynchronous;
55 visible: false;54 visible: false;
56 width: root.width;55 width: root.width;
5756
=== modified file 'tests/plugins/Dash/cardcreator/4.res'
--- tests/plugins/Dash/cardcreator/4.res 2014-12-01 15:53:18 +0000
+++ tests/plugins/Dash/cardcreator/4.res 2014-12-01 15:53:18 +0000
@@ -47,8 +47,7 @@
47 id: mascotImage; 47 id: mascotImage;
48 objectName: "mascotImage"; 48 objectName: "mascotImage";
49 anchors { verticalCenter: parent.verticalCenter; }49 anchors { verticalCenter: parent.verticalCenter; }
50 property bool doLoadSource: !NetworkingStatus.limitedBandwith;50 source: cardData && cardData["mascot"] || "";
51 source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["mascot"] || ""; }
52 width: units.gu(6);51 width: units.gu(6);
53 height: units.gu(5.625); 52 height: units.gu(5.625);
54 horizontalAlignment: Image.AlignHCenter; 53 horizontalAlignment: Image.AlignHCenter;
5554
=== modified file 'tests/plugins/Dash/cardcreator/5.res'
--- tests/plugins/Dash/cardcreator/5.res 2014-12-01 15:53:18 +0000
+++ tests/plugins/Dash/cardcreator/5.res 2014-12-01 15:53:18 +0000
@@ -49,8 +49,7 @@
49 CroppedImageMinimumSourceSize {49 CroppedImageMinimumSourceSize {
50 id: artImage;50 id: artImage;
51 objectName: "artImage";51 objectName: "artImage";
52 property bool doLoadSource: !NetworkingStatus.limitedBandwith;52 source: cardData && cardData["art"] || "";
53 source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["art"] || ""; }
54 asynchronous: root.asynchronous;53 asynchronous: root.asynchronous;
55 visible: false;54 visible: false;
56 width: root.width;55 width: root.width;
5756
=== modified file 'tests/plugins/Dash/cardcreator/7.res'
--- tests/plugins/Dash/cardcreator/7.res 2014-12-01 15:53:18 +0000
+++ tests/plugins/Dash/cardcreator/7.res 2014-12-01 15:53:18 +0000
@@ -68,8 +68,7 @@
68 id: mascotImage; 68 id: mascotImage;
69 objectName: "mascotImage"; 69 objectName: "mascotImage";
70 anchors { verticalCenter: parent.verticalCenter; } 70 anchors { verticalCenter: parent.verticalCenter; }
71 property bool doLoadSource: !NetworkingStatus.limitedBandwith;71 source: cardData && cardData["mascot"] || "";
72 source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["mascot"] || ""; }
73 width: units.gu(6);72 width: units.gu(6);
74 height: units.gu(5.625); 73 height: units.gu(5.625);
75 horizontalAlignment: Image.AlignHCenter; 74 horizontalAlignment: Image.AlignHCenter;
7675
=== modified file 'tests/qmltests/Dash/tst_Card.qml'
--- tests/qmltests/Dash/tst_Card.qml 2014-10-14 15:44:00 +0000
+++ tests/qmltests/Dash/tst_Card.qml 2014-12-01 15:53:18 +0000
@@ -17,7 +17,6 @@
17import QtQuick 2.017import QtQuick 2.0
18import QtTest 1.018import QtTest 1.0
19import Ubuntu.Components 0.119import Ubuntu.Components 0.1
20import Ubuntu.Connectivity 1.0
21import Unity.Test 0.1 as UT20import Unity.Test 0.1 as UT
22import "../../../qml/Dash"21import "../../../qml/Dash"
23import "CardHelpers.js" as Helpers22import "CardHelpers.js" as Helpers
@@ -221,7 +220,6 @@
221220
222 function init() {221 function init() {
223 loader.visible = true;222 loader.visible = true;
224 NetworkingStatus.limitedBandwith = false;
225 }223 }
226224
227 function cleanup() {225 function cleanup() {
@@ -585,25 +583,5 @@
585 verify((card.width - titleToCard.x - titleToCard.width) === units.gu(1));583 verify((card.width - titleToCard.x - titleToCard.width) === units.gu(1));
586 }584 }
587 }585 }
588
589 function test_load_images_visibility_network_data() {
590 return [
591 { tag: "Visible, network", visible: true, limitedBandwith: false },
592 { tag: "Visible, no network", visible: true, limitedBandwith: true },
593 { tag: "Not Visible, network", visible: false, limitedBandwith: false },
594 { tag: "Not Visible, no network", visible: false, limitedBandwith: true }
595 ];
596 }
597
598 function test_load_images_visibility_network(data) {
599 loader.visible = data.visible;
600 NetworkingStatus.limitedBandwith = data.limitedBandwith;
601
602 selector.selectedIndex = 0;
603 waitForRendering(selector);
604 waitForRendering(card);
605
606 verify(data.visible || !data.limitedBandwith || artImage.source == "");
607 }
608 }586 }
609}587}
610588
=== modified file 'tests/qmltests/Dash/tst_Dash.qml'
--- tests/qmltests/Dash/tst_Dash.qml 2014-10-30 14:55:29 +0000
+++ tests/qmltests/Dash/tst_Dash.qml 2014-12-01 15:53:18 +0000
@@ -243,8 +243,10 @@
243 tryCompare(scopesOverviewRepeater, "count", 0);243 tryCompare(scopesOverviewRepeater, "count", 0);
244244
245 // Click on a temp scope in the search245 // Click on a temp scope in the search
246 var dashCategorysearchA = findChild(searchResultsViewer, "dashCategorysearchA");246 tryCompareFunction( function() {
247 var cardTempScope = findChild(dashCategorysearchA, "delegate2");247 return findChild(findChild(searchResultsViewer, "dashCategorysearchA"), "delegate2") != null;
248 }, true);
249 var cardTempScope = findChild(findChild(searchResultsViewer, "dashCategorysearchA"), "delegate2");
248 verify(cardTempScope, "Could not find delegate2");250 verify(cardTempScope, "Could not find delegate2");
249251
250 waitForRendering(cardTempScope);252 waitForRendering(cardTempScope);
251253
=== modified file 'tests/qmltests/Dash/tst_GenericScopeView.qml'
--- tests/qmltests/Dash/tst_GenericScopeView.qml 2014-11-24 11:28:41 +0000
+++ tests/qmltests/Dash/tst_GenericScopeView.qml 2014-12-01 15:53:18 +0000
@@ -293,6 +293,7 @@
293 },293 },
294 true);294 true);
295 var tile = findChild(findChild(genericScopeView, "dashCategory"+category), "delegate"+delegate);295 var tile = findChild(findChild(genericScopeView, "dashCategory"+category), "delegate"+delegate);
296 waitForRendering(tile);
296 mouseClick(tile, tile.width / 2, tile.height / 2);297 mouseClick(tile, tile.width / 2, tile.height / 2);
297 tryCompare(testCase.subPageLoader, "open", true);298 tryCompare(testCase.subPageLoader, "open", true);
298 tryCompare(testCase.subPageLoader, "x", 0);299 tryCompare(testCase.subPageLoader, "x", 0);

Subscribers

People subscribed via source and target branches