Commit 0d87cab9 authored by Igor Kushnir's avatar Igor Kushnir

Don't show a busy indicator for 5s after a task completion

81220db1 eliminated such misleading
progress reports for items that use a busy indicator themselves, but
missed the case when a quick percent-progress-reporting task follows
right after a busy-indicator task.

For example, GrepJob's WorkCollectFiles step uses a busy indicator, then
its next WorkGrep step reports progress in percents. So when the
WorkGrep step is completed in less than a second (e.g. when there are
not many files to search in and the looked-for string is not present in
any of them), the bottom-right-corner progress bar shows
a busy indicator for 5 seconds.

Let us display 100% progress during these 5 seconds instead.
parent 1a61900c
......@@ -217,20 +217,16 @@ void StatusbarProgressWidget::slotProgressItemCompleted( ProgressItem *item )
return; // we are only interested in top level items
bool itemUsesBusyIndicator = item->usesBusyIndicator();
item = nullptr;
connectSingleItem(); // if going back to 1 item
if ( ProgressManager::instance()->isEmpty() ) { // No item
// If completed item uses busy indicator and progress manager doesn't have any
// other items, then we should set it progress to 100% to indicate finishing.
// Without this fix we will show busy indicator for already finished item
// for next 5s.
if ( itemUsesBusyIndicator ) {
activateSingleItemMode( 100 );
// If the progress manager doesn't have other progress items, set the progress to 100%
// to indicate completion. Otherwise, if @p item uses a busy indicator, or had been running
// for less than a second and was preceded by a different item that uses a busy indicator,
// we could be showing a busy indicator for 5 seconds without any task in progress.
activateSingleItemMode( 100 );
// Done. In 5s the progress-widget will close, then we can clean up the statusbar
} else if ( mCurrentItem ) { // Exactly one item
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