fix qml warnings

This commit is contained in:
Marco Martin 2014-11-03 21:17:02 +01:00
parent 711b0c8136
commit 0578241078

View file

@ -102,25 +102,23 @@ Item {
Component.onCompleted: { Component.onCompleted: {
console.log(ofonoManager.modems) console.log(ofonoManager.modems)
} }
modemPath: ofonoManager.modems[0] modemPath: ofonoManager.modems.length > 0 ? ofonoManager.modems[0] : ""
} }
OfonoModem { OfonoModem {
id: modem1 id: modem1
modemPath: ofonoManager.modems[0] modemPath: ofonoManager.modems.length > 0 ? ofonoManager.modems[0] : ""
} }
OfonoContextConnection { OfonoContextConnection {
id: context1 id: context1
contextPath : ofono1.contexts[0] contextPath : ofono1.contexts.length > 0 ? ofono1.contexts[0] : ""
Component.onCompleted: { Component.onCompleted: {
print("Context Active: " + context1.active) print("Context Active: " + context1.active)
textLine.text = context1.active ? "online" : "offline"
} }
onActiveChanged: { onActiveChanged: {
print("Context Active: " + context1.active) print("Context Active: " + context1.active)
textLine.text = context1.active ? "online" : "offline"
} }
} }
@ -322,9 +320,9 @@ Item {
left: strengthIcon.right left: strengthIcon.right
verticalCenter: parent.verticalCenter 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" color: "white"
font.pixelSize: height / 2 font.pixelSize: parent.height / 2
} }
Text { Text {
id: clock id: clock