on xenial help sign in
ClientIndicator: be more informative about loading failures for dynamically created objects
commit934acb34955ac926d1d0c889632d7b92dfac0ba3 authorMarco Trevisan (Treviño) <mail@3v1n0.net> dateMon 27 Jun 2016, 18:42 (10 years ago) parent62094ca42df76d
2 files changed+14−1
qml/Panel/Indicators/client/IndicatorsClient.qml+7−1 qml/Panel/Indicators/client/IndicatorsList.qml+7
qml/Panel/Indicators/client/IndicatorsClient.qml+7−1
@@ -19,7 +19,6 @@
1919
2020import QtQuick 2.4
2121import Ubuntu.Components 1.3
22−import Ubuntu.Components.ListItems 1.3 as ListItem
2322
2423Rectangle {
2524 color: theme.palette.normal.background
@@ -37,6 +36,13 @@ Rectangle {
3736 function reset() {
3837 clear();
3938 var component = Qt.createComponent("IndicatorsList.qml");
39+ if (component.status !== Component.Ready) {
40+ if (component.status === Component.Error)
41+ console.error("Error: " + component.errorString());
42+
43+ return;
44+ }
45+
4046 var page = component.createObject(pages, {"profile": indicatorProfile});
4147 push(page);
4248 }
qml/Panel/Indicators/client/IndicatorsList.qml+7
@@ -58,6 +58,13 @@ Page {
5858
5959 onClicked: {
6060 var new_page = Qt.createComponent("IndicatorRepresentation.qml");
61+ if (new_page.status !== Component.Ready) {
62+ if (new_page.status === Component.Error)
63+ console.error("Error: " + new_page.errorString());
64+
65+ return;
66+ }
67+
6168 page.pageStack.push(new_page.createObject(pages), {"indicatorProperties" : model.indicatorProperties });
6269 }
6370 }