diff --git a/src/gui/FileListWidget.cxx b/src/gui/FileListWidget.cxx index 0cce973b9..5a73f3bcb 100644 --- a/src/gui/FileListWidget.cxx +++ b/src/gui/FileListWidget.cxx @@ -157,8 +157,7 @@ ProgressDialog& FileListWidget::progress() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void FileListWidget::incProgress() { - if(_includeSubDirs) - progress().incProgress(); + progress().incProgress(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/ProgressDialog.cxx b/src/gui/ProgressDialog.cxx index 1307c5bfb..fc1420705 100644 --- a/src/gui/ProgressDialog.cxx +++ b/src/gui/ProgressDialog.cxx @@ -97,7 +97,8 @@ void ProgressDialog::setRange(int start, int finish, int step) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void ProgressDialog::resetProgress() { - myProgress = myStepProgress = 0; + myLastTick = TimerManager::getTicks(); + myProgress = 0; mySlider->setValue(0); myIsCancelled = false; } @@ -105,10 +106,10 @@ void ProgressDialog::resetProgress() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void ProgressDialog::setProgress(int progress) { - // Only increase the progress bar if we have arrived at a new step - if(progress - myStepProgress >= myStep) + // Only increase the progress bar if some time has passed + if(TimerManager::getTicks() - myLastTick > 100000) // update every 1/10th second { - myStepProgress = progress; + myLastTick = TimerManager::getTicks(); mySlider->setValue(progress % (myFinish - myStart + 1)); // Since this dialog is usually called in a tight loop that doesn't diff --git a/src/gui/ProgressDialog.hxx b/src/gui/ProgressDialog.hxx index 577e4e265..910094c0f 100644 --- a/src/gui/ProgressDialog.hxx +++ b/src/gui/ProgressDialog.hxx @@ -47,7 +47,7 @@ class ProgressDialog : public Dialog int myStart{0}, myFinish{0}, myStep{0}; int myProgress{0}; - int myStepProgress{0}; + uInt64 myLastTick{0}; bool myIsCancelled{false}; private: