Skip to content

Commit

Permalink
simplified stopRendering just before commitChanges
Browse files Browse the repository at this point in the history
  • Loading branch information
luipir committed Oct 11, 2017
1 parent 46551a9 commit 206965c
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions src/app/qgisapp.cpp
Expand Up @@ -8003,34 +8003,15 @@ void QgisApp::saveEdits( QgsMapLayer *layer, bool leaveEditable, bool triggerRep
if ( vlayer == activeLayer() )
mSaveRollbackInProgress = true;

// wait for end of rendering to avoid lock in case of
// stop rendering to avoid lock in case of
// splilte and gpkg fix #15498
// Wait only if the current layer is in the rendering pool
if ( mMapCanvas->mapSettings().layers().contains( vlayer->id() ) )
{
if ( vlayer->dataProvider()->storageType().count( "SQLite" ) ||
vlayer->dataProvider()->storageType().count( "GPKG" ) )
{
// notify wait the rendering end
if ( mMapCanvas->isDrawing() )
{
// notify
QgsMessageBarItem *item = new QgsMessageBarItem( tr( "Save edit paused" ),
tr( "Waiting for end of rendering" ),
QgsMessageBar::WARNING, 0 );
messageBar()->pushItem( item );
// wait
while ( mMapCanvas->isDrawing() )
{
QEventLoop loop;
QTimer t;
connect( &t, SIGNAL( timeout() ), &loop, SLOT( quit() ) );
t.start( 100 );
loop.exec();
}
// remove wait message
messageBar()->popWidget( item );
}
mMapCanvas->stopRendering();
}
}

Expand Down

0 comments on commit 206965c

Please sign in to comment.