~bregma/unity8/lp-1350878

« back to all changes in this revision

Viewing changes to plugins/Dash/CardCreator.js

  • Committer: CI bot
  • Author(s): Michał Sawicz
  • Date: 2014-08-15 17:37:19 UTC
  • mfrom: (1160.2.4 fix-card-test)
  • Revision ID: ps-jenkins@lists.canonical.com-20140815173719-8x2qwx8hi7km8o3e
Fix cardtool test and make card creator output debugging info on errors. 
Approved by: Andrea Cimitan, Daniel d'Andrada, PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
639
639
        implicitHeight += 'titleLabel.y + titleLabel.height + units.gu(1);\n';
640
640
    } else if (hasArt) {
641
641
        implicitHeight += 'artShapeHolder.height;\n';
 
642
    } else {
 
643
        implicitHeight = '';
642
644
    }
 
645
 
643
646
    // Close the AbstractButton
644
647
    code += implicitHeight + '}\n';
645
648
 
653
656
    var card = cardString(template, components);
654
657
    var code = imports + 'Component {\n' + card + '}\n';
655
658
 
656
 
    return Qt.createQmlObject(code, parent, "createCardComponent");
 
659
    try {
 
660
        return Qt.createQmlObject(code, parent, "createCardComponent");
 
661
    } catch (e) {
 
662
        console.error("ERROR: Invalid component created.");
 
663
        console.error("Template:");
 
664
        console.error(JSON.stringify(template));
 
665
        console.error("Components:");
 
666
        console.error(JSON.stringify(components));
 
667
        console.error("Code:");
 
668
        console.error(code);
 
669
        throw e;
 
670
    }
657
671
}