Skip to content
Permalink
Browse files

in case SQlite vectors wait end of rendering to avoid file lock: fixes

  • Loading branch information
luipir committed Oct 5, 2017
1 parent 1781cfc commit 8364b8d715fe8cf8d057c05f5a898c22232a47a2
Showing with 26 additions and 0 deletions.
  1. +26 −0 src/app/qgisapp.cpp
@@ -8003,6 +8003,32 @@ 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
// 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" ) )
{
// 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() )
{
QgsApplication::instance()->processEvents( QEventLoop::AllEvents, 100 );
}
// remove wait message
messageBar()->popWidget( item );
}
}
}

if ( !vlayer->commitChanges() )
{
mSaveRollbackInProgress = false;

0 comments on commit 8364b8d

Please sign in to comment.
You can’t perform that action at this time.