summaryrefslogtreecommitdiffstats
path: root/helper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'helper.cpp')
-rw-r--r--helper.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/helper.cpp b/helper.cpp
index 07a66c0..ae5eb36 100644
--- a/helper.cpp
+++ b/helper.cpp
@@ -246,6 +246,19 @@ namespace Helper {
Duration::Duration() : mHours(0), mMinutes(0), mSeconds(0) {}
+ Duration::Duration(qint64 seconds){
+ int sec(0), min(0), h(0);
+ // get hours
+ h = (seconds / 60 / 60) % 24;
+ // remaining minutes
+ min = (seconds / 60) % 60;
+ // seconds
+ sec = seconds % 60;
+ mHours = h;
+ mMinutes = min;
+ mSeconds = sec;
+ }
+
Duration::Duration(const QString &dur) : mHours(0), mMinutes(0), mSeconds(0){
QStringList parts = dur.split(':');
if(parts.size() == 3){