From: Brian Jones Date: Thu, 3 May 2012 21:49:19 +0000 (-0700) Subject: Adding a check to ensure the number isn't "undefined" before X-Git-Tag: 061412173448~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=90f0ae581972c79d6256c61132096bb1cd590600;p=profile%2Fivi%2Fhfdialer.git Adding a check to ensure the number isn't "undefined" before displaying it. --- diff --git a/qml/CallItemViewLarge.qml b/qml/CallItemViewLarge.qml index 01cc891..4d56b97 100644 --- a/qml/CallItemViewLarge.qml +++ b/qml/CallItemViewLarge.qml @@ -22,27 +22,23 @@ Item state : 'disconnected' onCallChanged: { - console.log("*** call changed in large, before if") - if(call && call.msisdn) { + console.log("*** call changed in large, before if") + if(call && call.msisdn) { console.log("*** in calllarge if >> " + call.state ); - - root.state = call.state - - /* if (call.name) { - root.callerLabelText = call.name; - - - } else { - */ - if (call.numberLen <= 10) - { - root.callerLabelText = call.msisdn[0] + call.msisdn[1] + call.msisdn[2] + '-' + - call.msisdn[3] + call.msisdn[4] + call.msisdn[5] + '-' + - call.msisdn[6] + call.msisdn[7] + call.msisdn[8] + call.msisdn[9]; - } - else - root.callerLabelText = call.msisdn; - //} + + root.state = call.state + + if (call.msisdn !== undefined && call.msisdn[0]!== undefined) + { + if (call.msisdn.trim().length <= 10) + { + root.callerLabelText = call.msisdn[0] + call.msisdn[1] + call.msisdn[2] + '-' + + call.msisdn[3] + call.msisdn[4] + call.msisdn[5] + '-' + + call.msisdn[6] + call.msisdn[7] + call.msisdn[8] + call.msisdn[9]; + } + else + root.callerLabelText = call.msisdn; + } } }