Skip to content

Commit 657ac10

Browse files
committedMay 29, 2016
QgsOgrProvider::addAttributes(): call invalidateConnections() for MapInfo
1 parent fe32ba4 commit 657ac10

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
 

‎src/providers/ogr/qgsogrprovider.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,13 @@ bool QgsOgrProvider::addAttributes( const QList<QgsField> &attributes )
11031103
if ( !doInitialActionsForEdition() )
11041104
return false;
11051105

1106+
if ( ogrDriverName == "MapInfo File" )
1107+
{
1108+
// adding attributes in mapinfo requires to be able to delete the .dat file
1109+
// so drop any cached connections.
1110+
QgsOgrConnPool::instance()->invalidateConnections( filePath() );
1111+
}
1112+
11061113
bool returnvalue = true;
11071114

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

0 commit comments

Comments
 (0)
Please sign in to comment.