Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix #7007, canvas is not refreshing when exiting editing mode
  • Loading branch information
dakcarto committed Jan 18, 2013
1 parent fed5240 commit 814d8e0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -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:
Expand All @@ -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();
}
Expand Down Expand Up @@ -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;
Expand All @@ -5316,6 +5320,7 @@ void QgisApp::cancelEdits( QgsMapLayer *layer, bool leaveEditable )
.arg( vlayer->name() )
.arg( vlayer->commitErrors().join( "\n " ) ) );
}
mMapCanvas->freeze( false );

if ( leaveEditable )
{
Expand Down

0 comments on commit 814d8e0

Please sign in to comment.