Put in code to display the call duration properly
authorBrian Jones <brian.j.jones@intel.com>
Thu, 12 Apr 2012 18:51:36 +0000 (11:51 -0700)
committerBrian Jones <brian.j.jones@intel.com>
Thu, 12 Apr 2012 18:51:36 +0000 (11:51 -0700)
qml/CallItemViewLarge.qml
src/qmlcallitem.cpp

index 372af39..db0d879 100644 (file)
@@ -61,6 +61,7 @@ Item
     states {
         State {
             name: 'active'           
+           PropertyChanges {target: callDurationInd; text: "00:00:00"}
             PropertyChanges {target: answerButton; visible: false}
             PropertyChanges {target: hangupButton; visible: true; width: parent.width}
             PropertyChanges {target: stateInd; text: qsTr("Active")}
@@ -75,6 +76,7 @@ Item
 
         State {
             name: 'dialing'           
+           PropertyChanges {target: root; callDuration: "00:00:00"}
             PropertyChanges {target: answerButton; visible: false}
             PropertyChanges {target: hangupButton; visible: true; width: parent.width}
             PropertyChanges {target: stateInd; text: qsTr("Dialing...")}
@@ -89,6 +91,7 @@ Item
 
         State {
             name: 'incoming'            
+           PropertyChanges {target: callDurationInd; text: "00:00:00"}
             PropertyChanges {target: answerButton; visible: true}
             PropertyChanges {target: hangupButton; visible: true; width: parent.width * 0.45}
             PropertyChanges {target: stateInd; text: qsTr("Incoming...")}
@@ -102,7 +105,8 @@ Item
         }
 
         State {
-            name: 'disconnected'            
+            name: 'disconnected'    
+           PropertyChanges {target: callDurationInd; text: "00:00:00"}        
             PropertyChanges {target: answerButton; visible: false}
             PropertyChanges {target: hangupButton; visible: false}
             PropertyChanges {target: stateInd; text: qsTr("Disconnected")}
index 627974d..67355e9 100644 (file)
@@ -88,11 +88,13 @@ QDateTime QMLCallItem::startedAt() const
 int QMLCallItem::duration() const
 {
     TRACE;
-    return 32;    
 
-    if (d->proxy->callProxy())
-        return d->proxy->callProxy()->duration();
-    return 66;
+    if (d->proxy)
+    {
+        if (d->proxy->callProxy())
+               return d->proxy->callProxy()->duration();
+    }
+    return 0;
 }
 
 bool QMLCallItem::isMultiparty() const