Skip to content

Commit

Permalink
[app] Don't trigger repaint twice
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Nov 21, 2017
1 parent 17ca25f commit 9866b24
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8934,19 +8934,13 @@ void QgisApp::layerSubsetString()
// Set the sql in the query builder to the same in the prop dialog
// (in case the user has already changed it)
qb->setSql( vlayer->subsetString() );
// Open the query builder
if ( qb->exec() )
// Open the query builder and refresh symbology if sql has changed
// Note: repaintRequested is emitted directly from QgsQueryBuilder
// when the sql is set in the layer.
if ( qb->exec() && ( subsetBefore != qb->sql() ) && mLayerTreeView )
{
if ( subsetBefore != qb->sql() )
{
vlayer->triggerRepaint();
if ( mLayerTreeView )
{
mLayerTreeView->refreshLayerSymbology( vlayer->id() );
}
}
mLayerTreeView->refreshLayerSymbology( vlayer->id() );
}

}

void QgisApp::saveLastMousePosition( const QgsPointXY &p )
Expand Down

0 comments on commit 9866b24

Please sign in to comment.