on xenial help sign in
Remove artShapeSize from non cardtool cards

artShapeSize is only used in the cardtool card to read the value them we pass down in fixedArtShapeSize According to qmlprofiler evaluating this useless binding accounts for ~0.5% when scrolling up and down a very long scope

commite9f3de188910278d989ca63a7e772bbceebfa021 authorAlbert Astals Cid <albert.astals@canonical.com> dateMon 25 Jul 2016, 13:52 (10 years ago) parenta1bb75e
13 files changed+6−14
plugins/Dash/CardCreator.js+6−2 tests/plugins/Dash/cardcreator/1.res−1 tests/plugins/Dash/cardcreator/10.res−1 tests/plugins/Dash/cardcreator/11.res−1 tests/plugins/Dash/cardcreator/12.res−1 tests/plugins/Dash/cardcreator/2.res−1 tests/plugins/Dash/cardcreator/3.res−1 tests/plugins/Dash/cardcreator/4.res−1 tests/plugins/Dash/cardcreator/5.res−1 tests/plugins/Dash/cardcreator/6.res−1 tests/plugins/Dash/cardcreator/7.res−1 tests/plugins/Dash/cardcreator/8.res−1 tests/plugins/Dash/cardcreator/9.res−1
plugins/Dash/CardCreator.js+6−2
@@ -514,7 +514,9 @@ function cardString(template, components, isCardTool, artShapeStyle, categoryLay
514514 }
515515
516516 if (hasArt) {
517− code += 'readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);\n';
517+ if (isCardTool) {
518+ code += 'readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);\n';
519+ }
518520
519521 var artShapeAspect;
520522 if (isCardTool) {
@@ -582,7 +584,9 @@ function cardString(template, components, isCardTool, artShapeStyle, categoryLay
582584 .arg(fallbackStatusCode)
583585 .arg(fallbackURICode);
584586 } else {
585− code += 'readonly property size artShapeSize: Qt.size(-1, -1);\n'
587+ if (isCardTool) {
588+ code += 'readonly property size artShapeSize: Qt.size(-1, -1);\n'
589+ }
586590 }
587591
588592 if (headerAsOverlay) {
tests/plugins/Dash/cardcreator/1.res−1
@@ -11,7 +11,6 @@ AbstractButton {
1111 property int fixedHeaderHeight: -1;
1212 property size fixedArtShapeSize: Qt.size(-1, -1);
1313signal action(var actionId);
14−readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
1514Item {
1615 id: artShapeHolder;
1716 height: root.fixedArtShapeSize.height;
tests/plugins/Dash/cardcreator/10.res−1
@@ -49,7 +49,6 @@ Loader {
4949 }
5050 }
5151 }
52−readonly property size artShapeSize: Qt.size(-1, -1);
5352readonly property int headerHeight: row.height;
5453Row {
5554 id: row;
tests/plugins/Dash/cardcreator/11.res−1
@@ -49,7 +49,6 @@ Loader {
4949 }
5050 }
5151 }
52−readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
5352Item {
5453 id: artShapeHolder;
5554 height: root.fixedArtShapeSize.height;
tests/plugins/Dash/cardcreator/12.res−1
@@ -11,7 +11,6 @@ AbstractButton {
1111 property int fixedHeaderHeight: -1;
1212 property size fixedArtShapeSize: Qt.size(-1, -1);
1313signal action(var actionId);
14−readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
1514Item {
1615 id: artShapeHolder;
1716 height: root.fixedArtShapeSize.height;
tests/plugins/Dash/cardcreator/2.res−1
@@ -49,7 +49,6 @@ Loader {
4949 }
5050 }
5151 }
52−readonly property size artShapeSize: Qt.size(-1, -1);
5352readonly property int headerHeight: row.height;
5453Row {
5554 id: row;
tests/plugins/Dash/cardcreator/3.res−1
@@ -11,7 +11,6 @@ AbstractButton {
1111 property int fixedHeaderHeight: -1;
1212 property size fixedArtShapeSize: Qt.size(-1, -1);
1313signal action(var actionId);
14−readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
1514Item {
1615 id: artShapeHolder;
1716 height: root.fixedArtShapeSize.height;
tests/plugins/Dash/cardcreator/4.res−1
@@ -11,7 +11,6 @@ AbstractButton {
1111 property int fixedHeaderHeight: -1;
1212 property size fixedArtShapeSize: Qt.size(-1, -1);
1313signal action(var actionId);
14−readonly property size artShapeSize: Qt.size(-1, -1);
1514readonly property int headerHeight: row.height;
1615Row {
1716 id: row;
tests/plugins/Dash/cardcreator/5.res−1
@@ -11,7 +11,6 @@ AbstractButton {
1111 property int fixedHeaderHeight: -1;
1212 property size fixedArtShapeSize: Qt.size(-1, -1);
1313signal action(var actionId);
14−readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
1514Item {
1615 id: artShapeHolder;
1716 height: root.fixedArtShapeSize.height;
tests/plugins/Dash/cardcreator/6.res−1
@@ -49,7 +49,6 @@ Loader {
4949 }
5050 }
5151 }
52−readonly property size artShapeSize: Qt.size(-1, -1);
5352readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin;
5453Item {
5554 id: headerTitleContainer;
tests/plugins/Dash/cardcreator/7.res−1
@@ -49,7 +49,6 @@ Loader {
4949 }
5050 }
5151 }
52−readonly property size artShapeSize: Qt.size(-1, -1);
5352readonly property int headerHeight: row.height;
5453Row {
5554 id: row;
tests/plugins/Dash/cardcreator/8.res−1
@@ -49,7 +49,6 @@ Loader {
4949 }
5050 }
5151 }
52−readonly property size artShapeSize: Qt.size(-1, -1);
5352readonly property int headerHeight: row.height;
5453Row {
5554 id: row;
tests/plugins/Dash/cardcreator/9.res−1
@@ -11,7 +11,6 @@ AbstractButton {
1111 property int fixedHeaderHeight: -1;
1212 property size fixedArtShapeSize: Qt.size(-1, -1);
1313signal action(var actionId);
14−readonly property size artShapeSize: Qt.size(-1, -1);
1514readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin + audioProgressBar.height + audioProgressBar.anchors.topMargin;
1615Label {
1716 id: titleLabel;