ekiga r6199 - in trunk: . src/endpoints



Author: dsandras
Date: Tue Apr 15 19:21:14 2008
New Revision: 6199
URL: http://svn.gnome.org/viewvc/ekiga?rev=6199&view=rev

Log:
When we have a missed call, start_time is not valid.
Make sure we do not return insane value is that case.


Modified:
   trunk/ChangeLog
   trunk/src/endpoints/opal-call.cpp

Modified: trunk/src/endpoints/opal-call.cpp
==============================================================================
--- trunk/src/endpoints/opal-call.cpp	(original)
+++ trunk/src/endpoints/opal-call.cpp	Tue Apr 15 19:21:14 2008
@@ -215,11 +215,15 @@
 Opal::Call::get_duration () const
 {
   std::stringstream duration;
-  PTimeInterval t = PTime () - start_time;
+  
+  if (start_time.IsValid ()) {
 
-  duration << setfill ('0') << setw (2) << t.GetHours () << ":";
-  duration << setfill ('0') << setw (2) << (t.GetMinutes () % 60) << ":";
-  duration << setfill ('0') << setw (2) << (t.GetSeconds () % 60);
+    PTimeInterval t = PTime () - start_time;
+
+    duration << setfill ('0') << setw (2) << t.GetHours () << ":";
+    duration << setfill ('0') << setw (2) << (t.GetMinutes () % 60) << ":";
+    duration << setfill ('0') << setw (2) << (t.GetSeconds () % 60);
+  }
 
   return duration.str ();
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]