Skip to content

Commit

Permalink
Remove progress task from identify action
Browse files Browse the repository at this point in the history
Seems that some providers trigger an issue with the progress task
(likely due to a local event loop running on the main thread triggering
a processEvents call).

Workaround the issue by just removing the progress task -- it's
unlikely to be missed anyway.

Fixes #20459
  • Loading branch information
nyalldawson committed Nov 22, 2018
1 parent d9736eb commit 57c117c
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/app/qgsmaptoolidentifyaction.cpp
Expand Up @@ -38,7 +38,6 @@
#include "qgsunittypes.h"
#include "qgsstatusbar.h"
#include "qgsactionscoperegistry.h"
#include "qgsproxyprogresstask.h"
#include "qgssettings.h"
#include "qgsmapmouseevent.h"

Expand Down Expand Up @@ -112,14 +111,6 @@ void QgsMapToolIdentifyAction::showAttributeTable( QgsMapLayer *layer, const QLi
void QgsMapToolIdentifyAction::identifyFromGeometry()
{
resultsDialog()->clear();

QgsProxyProgressTask *task = new QgsProxyProgressTask( tr( "Identifying features" ) );
QgsApplication::taskManager()->addTask( task );

connect( this, &QgsMapToolIdentifyAction::identifyProgress, task, [ = ]( int i, int n )
{
task->setProxyProgress( static_cast<double>( i ) * 100.0 / n );
} );
connect( this, &QgsMapToolIdentifyAction::identifyMessage, QgisApp::instance(), &QgisApp::showStatusMessage );

QgsGeometry geometry = mSelectionHandler->selectedGeometry();
Expand All @@ -139,7 +130,6 @@ void QgsMapToolIdentifyAction::identifyFromGeometry()

QList<IdentifyResult> results = QgsMapToolIdentify::identify( geometry, mode, AllLayers );

task->finalize( true );
disconnect( this, &QgsMapToolIdentifyAction::identifyMessage, QgisApp::instance(), &QgisApp::showStatusMessage );

if ( results.isEmpty() )
Expand Down

0 comments on commit 57c117c

Please sign in to comment.