Skip to content
Permalink
Browse files

[GRASS] fixed crash in add/delete column

  • Loading branch information
blazek committed Sep 29, 2015
1 parent d70c854 commit 63ddb1545a9621718abdfb100d6e640f9d05f341
Showing with 11 additions and 3 deletions.
  1. +10 −2 src/providers/grass/qgsgrassprovider.cpp
  2. +1 −1 src/providers/grass/qgsgrassprovider.h
@@ -561,7 +561,7 @@ void QgsGrassProvider::thaw()
#endif
}

bool QgsGrassProvider::closeEdit( bool newMap )
bool QgsGrassProvider::closeEdit( bool newMap, QgsVectorLayer *vectorLayer )
{
QgsDebugMsg( "entered" );

@@ -576,6 +576,10 @@ bool QgsGrassProvider::closeEdit( bool newMap )
if ( mLayer->map()->closeEdit( newMap ) )
{
loadMapInfo();
if ( vectorLayer )
{
vectorLayer->updateFields();
}
return true;
}
return false;
@@ -1005,6 +1009,9 @@ void QgsGrassProvider::startEditing( QgsVectorLayer *vectorLayer )

connect( vectorLayer->undoStack(), SIGNAL( indexChanged( int ) ), this, SLOT( onUndoIndexChanged( int ) ) );

// let qgis know (attribute table etc.) that we added topo symbol field
vectorLayer->updateFields();

QgsDebugMsg( "edit started" );
}

@@ -1465,7 +1472,8 @@ void QgsGrassProvider::onBeforeRollBack()
void QgsGrassProvider::onEditingStopped()
{
QgsDebugMsg( "entered" );
closeEdit( false );
QgsVectorLayer *vectorLayer = qobject_cast<QgsVectorLayer *>( sender() );
closeEdit( false, vectorLayer );
}

// -------------------------------------------------------------------------------
@@ -178,7 +178,7 @@ class GRASS_LIB_EXPORT QgsGrassProvider : public QgsVectorDataProvider
* @return true success
* @return false failed to close vector or vector was not in update mode
*/
bool closeEdit( bool newMap = false );
bool closeEdit( bool newMap = false, QgsVectorLayer *vectorLayer = 0 );

/** Get current number of lines.
* @return number of lines

0 comments on commit 63ddb15

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