From ee1960bb5dcb191a0eb9a51ecab18ac9bbc7fa8e Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Mon, 1 Aug 2011 07:07:40 +1000 Subject: [PATCH] Total time displayed wrong fix --- daily.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/daily.cpp b/daily.cpp index d1bf493c..e3fc1d4d 100644 --- a/daily.cpp +++ b/daily.cpp @@ -629,16 +629,19 @@ void Daily::Load(QDate date) } html+="Date"+tr("Sleep")+""+tr("Wake")+""+tr("Hours")+""; - int tt=cpap->total_time()/1000; + int tt=cpap->total_time()/1000.0; QDateTime date=QDateTime::fromMSecsSinceEpoch(cpap->first()); QDateTime date2=QDateTime::fromMSecsSinceEpoch(cpap->last()); + int h=tt/3600.0; + int m=(tt/60)%60; + int s=tt % 60; html+=QString("%1%2%3%4\n" "
\n") .arg(date.date().toString(Qt::SystemLocaleShortDate)) .arg(date.toString("HH:mm")) .arg(date2.toString("HH:mm")) - .arg(QString().sprintf("%02i:%02i",tt/3600,tt%60)); + .arg(QString().sprintf("%02i:%02i:%02i",h,m,s)); QString cs; if (cpap->machine->GetClass()!="PRS1") {