Fix render job duration when past midnight

BUG: 372370
parent d85742fc
......@@ -2032,11 +2032,10 @@ void RenderWidget::setRenderJob(const QString &dest, int progress)
slotCheckJob();
} else {
QDateTime startTime = item->data(1, TimeRole).toDateTime();
int days = startTime.daysTo (QDateTime::currentDateTime()) ;
double elapsedTime = days * 86400 + startTime.addDays(days).secsTo( QDateTime::currentDateTime() );
qint64 elapsedTime = startTime.secsTo(QDateTime::currentDateTime());
quint32 remaining = elapsedTime * (100.0 - progress) / progress;
int days = remaining / 86400;
int remainingSecs = remaining % 86400;
days = remaining / 86400;
QTime when = QTime ( 0, 0, 0, 0 ) ;
when = when.addSecs (remainingSecs) ;
QString est = (days > 0) ? i18np("%1 day ", "%1 days ", days) : QString();
......@@ -2060,8 +2059,9 @@ void RenderWidget::setRenderStatus(const QString &dest, int status, const QStrin
// Job finished successfully
item->setStatus(FINISHEDJOB);
QDateTime startTime = item->data(1, TimeRole).toDateTime();
int days = startTime.daysTo(QDateTime::currentDateTime()) ;
int elapsedTime = startTime.addDays(days).secsTo( QDateTime::currentDateTime() );
qint64 elapsedTime = startTime.secsTo(QDateTime::currentDateTime());
int days = elapsedTime / 86400;
elapsedTime -= (days * 86400);
QTime when = QTime ( 0, 0, 0, 0 ) ;
when = when.addSecs (elapsedTime) ;
QString est = (days > 0) ? i18np("%1 day ", "%1 days ", days) : QString();
......
......@@ -139,7 +139,7 @@ public:
ProfileError = 1,
ProxyWarning = 2
};
/** @brief Display warning message in render widget. */
void errorMessage(RenderError type, const QString &message);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment