Skip to content
Permalink
Browse files
Fix #7007, canvas is not refreshing when exiting editing mode
  • Loading branch information
dakcarto committed Jan 18, 2013
1 parent fed5240 commit 814d8e0e1b884d0076ad5ceda8eef81f6a96c67b
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/app/qgisapp.cpp
@@ -5234,14 +5234,15 @@ bool QgisApp::toggleEditing( QgsMapLayer *layer, bool allowCancel )
break;

case QMessageBox::Discard:
mMapCanvas->freeze( true );
if ( !vlayer->rollBack() )
{
QMessageBox::information( 0, tr( "Error" ), tr( "Problems during roll back" ) );
res = false;
}
mMapCanvas->freeze( false );

// canvas refreshes handled in QgsUndoWidget::indexChanged
//vlayer->triggerRepaint();
vlayer->triggerRepaint();
break;

default:
@@ -5250,7 +5251,9 @@ bool QgisApp::toggleEditing( QgsMapLayer *layer, bool allowCancel )
}
else //layer not modified
{
mMapCanvas->freeze( true );
vlayer->rollBack();
mMapCanvas->freeze( false );
res = true;
vlayer->triggerRepaint();
}
@@ -5306,6 +5309,7 @@ void QgisApp::cancelEdits( QgsMapLayer *layer, bool leaveEditable )
if ( vlayer == activeLayer() && leaveEditable )
mSaveRollbackInProgress = true;

mMapCanvas->freeze( true );
if ( !vlayer->rollBack() )
{
mSaveRollbackInProgress = false;
@@ -5316,6 +5320,7 @@ void QgisApp::cancelEdits( QgsMapLayer *layer, bool leaveEditable )
.arg( vlayer->name() )
.arg( vlayer->commitErrors().join( "\n " ) ) );
}
mMapCanvas->freeze( false );

if ( leaveEditable )
{

0 comments on commit 814d8e0

Please sign in to comment.