fix search result
[badge] / badgewindow.cpp
index 395d1d0..77f346d 100644 (file)
@@ -55,7 +55,7 @@ void BadgeWindow::selectedDay(QDate date)
 void BadgeWindow::search()
 {
     DialogSearch searchDialog;
-    QTime total;
+    int total;
     QString message;
     QString hours;
     QString minutes;
@@ -63,8 +63,9 @@ void BadgeWindow::search()
 
     total = searchDialog.totalHours(ok);
     if (ok) {
-        hours.setNum(total.hour());
-        minutes.setNum(total.minute());
+            qDebug() << "TIME " << total;
+        hours.setNum((int)(total / 3600));
+        minutes.setNum((int) ((total % 3600) / 60));
         message = "Total time is: " + hours + " hours and " + minutes + " minutes";
         QMessageBox::information(this, tr("Badge"), tr(message.toLatin1()));
     }