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 Approved by: Andrea Cimitan

commita8d3b3f0fa1e46c2bb04d7468af5d4b2234ba6b8 authorAlbert Astals Cid <albert.astals@canonical.com> dateFri 9 Sep 2016, 14:43 (10 years ago) parent349e0ccaa05252
13 files changed+3−15
plugins/Dash/CardCreator.js+3−3 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+3−3
@@ -508,10 +508,10 @@ function cardString(template, components, isCardTool, artShapeStyle, categoryLay
508508 }
509509
510510 if (hasArt) {
511− code += 'readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);\n';
512−
513511 var artShapeAspect;
514512 if (isCardTool) {
513+ code += 'readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);\n';
514+
515515 var artShapeAspect = components["art"] && components["art"]["aspect-ratio"] || 1;
516516 if (isNaN(artShapeAspect)) {
517517 artShapeAspect = 1;
@@ -575,7 +575,7 @@ function cardString(template, components, isCardTool, artShapeStyle, categoryLay
575575 .arg(artShapeHolderShapeCode)
576576 .arg(fallbackStatusCode)
577577 .arg(fallbackURICode);
578− } else {
578+ } else if (isCardTool) {
579579 code += 'readonly property size artShapeSize: Qt.size(-1, -1);\n'
580580 }
581581
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);
1514Loader {
1615 id: artShapeLoader;
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);
5352Loader {
5453 id: artShapeLoader;
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);
1514Loader {
1615 id: artShapeLoader;
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);
1514Loader {
1615 id: artShapeLoader;
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);
1514Loader {
1615 id: artShapeLoader;
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;