Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
QgsOgrProvider::addAttributes(): call invalidateConnections() for Map…
…Info
  • Loading branch information
rouault committed May 4, 2016
1 parent 8ea4470 commit 02be0cb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -1212,6 +1212,13 @@ bool QgsOgrProvider::addAttributes( const QList<QgsField> &attributes )
if ( !doInitialActionsForEdition() )
return false;

if ( ogrDriverName == "MapInfo File" )
{
// adding attributes in mapinfo requires to be able to delete the .dat file
// so drop any cached connections.
QgsOgrConnPool::instance()->invalidateConnections( filePath() );
}

bool returnvalue = true;

for ( QList<QgsField>::const_iterator iter = attributes.begin(); iter != attributes.end(); ++iter )
Expand Down

0 comments on commit 02be0cb

Please sign in to comment.