Merge lp:~cimi/unity8/cardCreatorCache_update-on-artShapeStyle into lp:unity8

Proposed by Andrea Cimitan
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 2444
Merged at revision: 2474
Proposed branch: lp:~cimi/unity8/cardCreatorCache_update-on-artShapeStyle
Merge into: lp:unity8
Diff against target: 78 lines (+21/-4)
3 files modified
plugins/Dash/CardCreatorCache.qml (+1/-1)
qml/Dash/CardTool.qml (+2/-2)
tests/qmltests/Dash/tst_Dash.qml (+18/-1)
To merge this branch: bzr merge lp:~cimi/unity8/cardCreatorCache_update-on-artShapeStyle
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
Unity8 CI Bot continuous-integration Approve
Review via email: mp+296329@code.launchpad.net

Commit message

Correctly refresh cardcreator cache on artshapestyle changes

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.
n
 * Did you perform an exploratory manual test run of your code change and any related functionality?
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
Albert Astals Cid (aacid) wrote :

Looks and works good.

Let's see if we can get a test before approving

review: Approve
2443. By Andrea Cimitan

add test!

2444. By Andrea Cimitan

different approach

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2444
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1368/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/1830
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/916
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/916
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/916
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1856
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1795
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1795
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1795
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1786
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1786/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1786
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1786/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1786
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1786/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1786
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1786/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1786
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1786/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1786
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1786/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1786
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1786/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1786
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1786/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1786
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1786/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) 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

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Dash/CardCreatorCache.qml'
2--- plugins/Dash/CardCreatorCache.qml 2016-03-04 13:57:48 +0000
3+++ plugins/Dash/CardCreatorCache.qml 2016-06-02 15:13:54 +0000
4@@ -29,7 +29,7 @@
5
6 var tString = JSON.stringify(template);
7 var cString = JSON.stringify(components);
8- var allString = tString + cString + isCardTool;
9+ var allString = tString + cString + isCardTool + artShapeStyle;
10 var component = cache[allString];
11 if (component === undefined) {
12 component = CardCreator.createCardComponent(root, template, components, isCardTool, artShapeStyle, allString);
13
14=== modified file 'qml/Dash/CardTool.qml'
15--- qml/Dash/CardTool.qml 2016-05-09 08:34:38 +0000
16+++ qml/Dash/CardTool.qml 2016-06-02 15:13:54 +0000
17@@ -70,7 +70,7 @@
18 // Not readonly because gets overwritten from GenericScopeView in some cases
19 property string artShapeStyle: categoryLayout === "carousel" ? "shadow" : "inset"
20
21- property var cardComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, false, artShapeStyle);
22+ property var cardComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, false, cardTool.artShapeStyle);
23
24 // FIXME: Saviq
25 // Only way for the card below to actually be laid out completely.
26@@ -212,7 +212,7 @@
27 "attributes": attributesModel.model,
28 "socialActions": socialActionsModel.model
29 }
30- sourceComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, true, artShapeStyle);
31+ sourceComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, true, cardTool.artShapeStyle);
32 onLoaded: {
33 item.objectName = "cardToolCard";
34 item.width = Qt.binding(function() { return cardTool.cardWidth !== -1 ? cardTool.cardWidth : item.implicitWidth; });
35
36=== modified file 'tests/qmltests/Dash/tst_Dash.qml'
37--- tests/qmltests/Dash/tst_Dash.qml 2016-05-27 13:54:07 +0000
38+++ tests/qmltests/Dash/tst_Dash.qml 2016-06-02 15:13:54 +0000
39@@ -88,7 +88,7 @@
40 return findChild(genericScopeView, categoryName);
41 }
42
43- function clickCategoryDelegate(category, delegate) {
44+ function getCategoryDelegate(category, delegate) {
45 var dashContentList = findChild(dash, "dashContentList");
46 var genericScopeView = dashContentList.currentItem;
47 if (category === undefined) category = 0;
48@@ -104,6 +104,11 @@
49 true);
50 var tile = findChild(findChild(genericScopeView, "dashCategory"+category), "delegate"+delegate);
51 waitForRendering(tile);
52+ return tile;
53+ }
54+
55+ function clickCategoryDelegate(category, delegate) {
56+ var tile = getCategoryDelegate(category, delegate);
57 mouseClick(tile);
58 }
59
60@@ -637,6 +642,18 @@
61 tryCompare(dashContent, "x", 0);
62 }
63
64+ function test_cardIconStyle()
65+ {
66+ dash.setCurrentScope("clickscope");
67+ var dashContent = findChild(dash, "dashContent");
68+ tryCompare(dashContent.currentScope, "id", "clickscope");
69+
70+ scrollToCategory("dashCategorypredefined");
71+ var tile = getCategoryDelegate("predefined", 2);
72+ var proportionalShape = findChildsByType(tile, "UCProportionalShape");
73+ compare(proportionalShape.length, 1);
74+ }
75+
76 function test_tempScopeItemXOnResize()
77 {
78 // Go to a temp scope

Subscribers

People subscribed via source and target branches