summaryrefslogtreecommitdiffstats
path: root/beetplayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'beetplayer.cpp')
-rw-r--r--beetplayer.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/beetplayer.cpp b/beetplayer.cpp
index c1ecc38..4371108 100644
--- a/beetplayer.cpp
+++ b/beetplayer.cpp
@@ -121,10 +121,20 @@ void BeetPlayer::setNumFiles(int numFiles){
}
void BeetPlayer::setPlayListLength(quint64 seconds){
- int h = (seconds / 60 / 60);
+ int h = static_cast<int>((seconds / 60 / 60));
+ int days = 0;
+ if(h > 24){
+ days = h / 24;
+ h = h % 24;
+ }
int min = (seconds / 60) % 60;
int secs = seconds % 60;
- QString r = QString("%1:%2:%3").arg(h, 3, 10, QChar('0')).arg(min, 2, 10, QChar('0')).arg(secs, 2, 10, QChar('0'));
+ QString r;
+ if(days > 0){
+ r = QString("%1d, %2:%3:%4h").arg(days, 1, 10, QChar('0')).arg(h, 2, 10, QChar('0')).arg(min, 2, 10, QChar('0')).arg(secs, 2, 10, QChar('0'));
+ }else{
+ r = QString("%1:%2:%3h").arg(h, 2, 10, QChar('0')).arg(min, 2, 10, QChar('0')).arg(secs, 2, 10, QChar('0'));
+ }
mPlaylistDurL->setText(r);
}