From: Arun Ravindran <ext-arun.1.ravind...@nokia.com>

The m_updateTimer, updates the call duration read from the Callproxy to the 
callitemview.
When the call is dialing, or alerting and if the timer is elapsed it reads the 
starttime
property (which is NULL), and gets the elapsed value from it, even if it is not 
valid, which
results in wrong time string (which is not the actual duration of the call) 
updated to the callitem.

Fixed by checking the validity of the m_startTime, before returning a duration 
and also checking it
before updating the duration test in callitemview.
---
 src/callitemview.cpp |    7 +++++--
 src/callproxy.cpp    |    3 ++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/callitemview.cpp b/src/callitemview.cpp
index b7ed2ae..cb1b39b 100644
--- a/src/callitemview.cpp
+++ b/src/callitemview.cpp
@@ -128,8 +128,11 @@ void CallItemView::initLayout()
 
 void CallItemView::updateDurationLabel()
 {
-    QTime t = QTime(0,0).addSecs(m_controller->duration()/1000);
-    durationLabel()->setText(t.toString(Qt::TextDate));
+    //modify the duration string only if there is a valid data.
+    if(m_controller->duration()) {
+        QTime t = QTime(0,0).addSecs(m_controller->duration());
+        durationLabel()->setText(t.toString(Qt::TextDate));
+    }
 }
 
 void CallItemView::updateStatusLabel()
diff --git a/src/callproxy.cpp b/src/callproxy.cpp
index 5d1689c..76b3213 100644
--- a/src/callproxy.cpp
+++ b/src/callproxy.cpp
@@ -98,7 +98,8 @@ QDateTime CallProxy::startTime() const
 int CallProxy::duration() const
 {
     TRACE
-    return m_startTime.time().elapsed();
+    // Returns the elapsed duration in seconds
+    return m_startTime.isValid()?m_startTime.time().elapsed()/1000:0;
 }
 
 QString CallProxy::reason() const
-- 
1.7.0.4

_______________________________________________
MeeGo-handset mailing list
MeeGo-handset@lists.meego.com
http://lists.meego.com/listinfo/meego-handset

Reply via email to