From 0578241078d06c1e2be875d81d25c817fc9d826d Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 3 Nov 2014 21:17:02 +0100 Subject: [PATCH] fix qml warnings --- shell/contents/views/Desktop.qml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/shell/contents/views/Desktop.qml b/shell/contents/views/Desktop.qml index 6a060ffc..701d476f 100644 --- a/shell/contents/views/Desktop.qml +++ b/shell/contents/views/Desktop.qml @@ -102,25 +102,23 @@ Item { Component.onCompleted: { console.log(ofonoManager.modems) } - modemPath: ofonoManager.modems[0] + modemPath: ofonoManager.modems.length > 0 ? ofonoManager.modems[0] : "" } OfonoModem { id: modem1 - modemPath: ofonoManager.modems[0] + modemPath: ofonoManager.modems.length > 0 ? ofonoManager.modems[0] : "" } OfonoContextConnection { id: context1 - contextPath : ofono1.contexts[0] + contextPath : ofono1.contexts.length > 0 ? ofono1.contexts[0] : "" Component.onCompleted: { print("Context Active: " + context1.active) - textLine.text = context1.active ? "online" : "offline" } onActiveChanged: { print("Context Active: " + context1.active) - textLine.text = context1.active ? "online" : "offline" } } @@ -322,9 +320,9 @@ Item { left: strengthIcon.right verticalCenter: parent.verticalCenter } - text: netreg.strength + "% " + (ofonoManager.available ? netreg.currentOperator["Name"].toString() :"Ofono not available") + text: netreg.strength + "% " + (ofonoManager.available && netreg.currentOperator ? netreg.currentOperator["Name"].toString() :"Ofono not available") color: "white" - font.pixelSize: height / 2 + font.pixelSize: parent.height / 2 } Text { id: clock