Skip to content

Commit e744455

Browse files
committed
Fix stats dock handling when refresh is clicked lots of times quickly
(cherry-picked from 2233bd4)
1 parent 21c5eaf commit e744455

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/app/qgsstatisticalsummarydockwidget.cpp

+10-4
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,16 @@ void QgsStatisticalSummaryDockWidget::refreshStatistics()
188188

189189
void QgsStatisticalSummaryDockWidget::gathererFinished()
190190
{
191-
mGatherer = nullptr;
192-
mCalculatingProgressBar->setValue( -1 );
193-
mCancelButton->hide();
194-
mCalculatingProgressBar->hide();
191+
QgsStatisticsValueGatherer *gatherer = qobject_cast<QgsStatisticsValueGatherer *>( QObject::sender() );
192+
// this may have been sent from a gathererer which was canceled previously and we don't care
193+
// about it anymore...
194+
if ( gatherer == mGatherer )
195+
{
196+
mGatherer = nullptr;
197+
mCalculatingProgressBar->setValue( -1 );
198+
mCancelButton->hide();
199+
mCalculatingProgressBar->hide();
200+
}
195201
}
196202

197203
void QgsStatisticalSummaryDockWidget::updateNumericStatistics()

0 commit comments

Comments
 (0)