Skip to content

Commit 2233bd4

Browse files
committed
Fix stats dock handling when refresh is clicked lots of times quickly
1 parent 8961ac4 commit 2233bd4

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
@@ -219,10 +219,16 @@ void QgsStatisticalSummaryDockWidget::refreshStatistics()
219219

220220
void QgsStatisticalSummaryDockWidget::gathererFinished()
221221
{
222-
mGatherer = nullptr;
223-
mCalculatingProgressBar->setValue( -1 );
224-
mCancelButton->hide();
225-
mCalculatingProgressBar->hide();
222+
QgsStatisticsValueGatherer *gatherer = qobject_cast<QgsStatisticsValueGatherer *>( QObject::sender() );
223+
// this may have been sent from a gathererer which was canceled previously and we don't care
224+
// about it anymore...
225+
if ( gatherer == mGatherer )
226+
{
227+
mGatherer = nullptr;
228+
mCalculatingProgressBar->setValue( -1 );
229+
mCancelButton->hide();
230+
mCalculatingProgressBar->hide();
231+
}
226232
}
227233

228234
void QgsStatisticalSummaryDockWidget::updateNumericStatistics()

0 commit comments

Comments
 (0)