on xenial help sign in
Fix cardcreator and print debugging output on error.
95d9eafMichał Sawicz
plugins/Dash/CardCreator.js+19−1
@@ -639,7 +639,12 @@ function cardString(template, components) {
639 implicitHeight += 'titleLabel.y + titleLabel.height + units.gu(1);\n';
639 implicitHeight += 'titleLabel.y + titleLabel.height + units.gu(1);\n';
640 } else if (hasArt) {
640 } else if (hasArt) {
641 implicitHeight += 'artShapeHolder.height;\n';
641 implicitHeight += 'artShapeHolder.height;\n';
642+ } else {
643+ // No implicit height, close
644+ code += '}\n';
645+ return code
642 }
646 }
647+
643 // Close the AbstractButton
648 // Close the AbstractButton
644 code += implicitHeight + '}\n';
649 code += implicitHeight + '}\n';
645
650
@@ -653,5 +658,18 @@ function createCardComponent(parent, template, components) {
653 var card = cardString(template, components);
658 var card = cardString(template, components);
654 var code = imports + 'Component {\n' + card + '}\n';
659 var code = imports + 'Component {\n' + card + '}\n';
655
660
661+ var o = null;
662+ try {
656− return Qt.createQmlObject(code, parent, "createCardComponent");
663+ return Qt.createQmlObject(code, parent, "createCardComponent");
664+ } catch (e) {
665+ var k;
666+ console.error("ERROR: Invalid component created.");
667+ console.error("Template:");
668+ console.error(JSON.stringify(template));
669+ console.error("Components:");
670+ console.error(JSON.stringify(components));
671+ console.error("Code:");
672+ console.error(code);
673+ throw e;
674+ }
657}
675}