Skip to content

Commit

Permalink
fix export job progress may flicker w/ "--:--:--"
Browse files Browse the repository at this point in the history
  • Loading branch information
ddennedy committed Jan 2, 2025
1 parent 4e68cb5 commit 6115164
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/jobqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ void JobQueue::onProgressUpdated(QStandardItem *standardItem, int percent)
remaining = tr("paused");
} else if (percent > 0) {
auto time = job->estimateRemaining(percent);
if (percent > 2 && QTime(0, 0).secsTo(time) > 0)
if (QTime(0, 0).secsTo(time) == 0)
return;
if (percent > 2)
remaining = time.toString();
remaining = QStringLiteral("%1% (%2)").arg(percent).arg(remaining);
}
Expand Down
2 changes: 1 addition & 1 deletion src/jobs/meltjob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ void MeltJob::onReadyRead()
index = msg.indexOf("percentage:");
if (index > -1) {
int percent = msg.mid(index + 11).toInt();
if (percent != m_previousPercent) {
if (percent > 0 && percent != m_previousPercent) {
emit progressUpdated(m_item, percent);
QCoreApplication::processEvents();
m_previousPercent = percent;
Expand Down

0 comments on commit 6115164

Please sign in to comment.