summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeslie Zhai <[email protected]>2017-05-18 10:24:42 +0800
committerLeslie Zhai <[email protected]>2017-05-18 10:24:42 +0800
commit026a29ea79312a5adabe7c2a6c04cac2330eac5d (patch)
treed7f6e4a81d8b927844a0341823bafd3d6fcc85da
parent364871bc06da58e14aaad65cf57fb5c1db7d263a (diff)
Fix no Elapsed nor Remaining time information issue.
REVIEW: 130132 BUG: 379448
-rw-r--r--src/k3bjobprogressdialog.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/k3bjobprogressdialog.cpp b/src/k3bjobprogressdialog.cpp
index 1091f6c..3212a78 100644
--- a/src/k3bjobprogressdialog.cpp
+++ b/src/k3bjobprogressdialog.cpp
@@ -547,15 +547,15 @@ void K3b::JobProgressDialog::slotProgress( int percent )
setWindowTitle( QString( "(%1%) %2" ).arg(percent).arg(m_job->jobDescription()) );
}
- if( m_timer.isValid() ) {
- qint64 elapsed = m_timer.elapsed();
- m_labelElapsedTime->setText( i18nc( "@info %1 is a duration formatted using QLocale::toString",
- "Elapsed time: %1", QLocale().toString( QTime().addSecs( elapsed ), QLocale::NarrowFormat ) ) );
+ if (m_timer.isValid()) {
+ qint64 elapsed = m_timer.elapsed();
+ m_labelElapsedTime->setText(i18nc("@info %1 is a duration formatted",
+ "Elapsed time: %1", QTime::fromMSecsSinceStartOfDay(elapsed).toString("hh:mm:ss")));
// Update "Remaining time" max. each second (1000 ms)
- if ( elapsed - m_lastProgressUpdateTime > 999 ) {
- m_labelRemainingTime->setText( i18nc( "@info %1 is a duration formatted using QLocale::toString",
- "Remaining: %1", QLocale().toString( QTime().addSecs(
- ( d->lastProgress > 0 && d->lastProgress < 100 ) ? elapsed * ( 100 - d->lastProgress) / d->lastProgress : 0 ), QLocale::NarrowFormat ) ) );
+ if (elapsed - m_lastProgressUpdateTime > 999) {
+ m_labelRemainingTime->setText(i18nc("@info %1 is a duration formatted",
+ "Remaining: %1", QTime::fromMSecsSinceStartOfDay(
+ (d->lastProgress > 0 && d->lastProgress < 100) ? elapsed * (100 - d->lastProgress) / d->lastProgress : 0).toString("hh:mm:ss")));
m_lastProgressUpdateTime = elapsed;
}
}