Skip to content
Permalink
Browse files

Merge pull request #3057 from manisandro/ogrpool_datasourceuri

Consistently use datasource instead of filepath when ref/unref-ing
  • Loading branch information
manisandro committed May 4, 2016
2 parents 919c54e + f261888 commit ca74cc0732ac8bdda9dab4c8e19d0c3b02c7a169
Showing with 8 additions and 8 deletions.
  1. +8 −8 src/providers/ogr/qgsogrprovider.cpp
@@ -375,7 +375,7 @@ QgsOgrProvider::QgsOgrProvider( QString const & uri )
<< QgsVectorDataProvider::NativeType( tr( "Date & Time" ), "datetime", QVariant::DateTime );
}

QgsOgrConnPool::instance()->ref( mFilePath );
QgsOgrConnPool::instance()->ref( dataSourceUri() );
}

QgsOgrProvider::~QgsOgrProvider()
@@ -719,7 +719,7 @@ OGRwkbGeometryType QgsOgrProvider::getOgrGeomType( OGRLayerH ogrLayer )

void QgsOgrProvider::loadFields()
{
QgsOgrConnPool::instance()->invalidateConnections( filePath() );
QgsOgrConnPool::instance()->invalidateConnections( dataSourceUri() );
//the attribute fields need to be read again when the encoding changes
mAttributeFields.clear();

@@ -1408,7 +1408,7 @@ bool QgsOgrProvider::changeAttributeValues( const QgsChangedAttributesMap &attr_
{
pushError( tr( "OGR error syncing to disk: %1" ).arg( CPLGetLastErrorMsg() ) );
}
QgsOgrConnPool::instance()->invalidateConnections( filePath() );
QgsOgrConnPool::instance()->invalidateConnections( dataSourceUri() );
return true;
}

@@ -1475,7 +1475,7 @@ bool QgsOgrProvider::changeGeometryValues( const QgsGeometryMap &geometry_map )

OGR_F_Destroy( theOGRFeature );
}
QgsOgrConnPool::instance()->invalidateConnections( filePath() );
QgsOgrConnPool::instance()->invalidateConnections( dataSourceUri() );
return syncToDisc();
}

@@ -2674,7 +2674,7 @@ QByteArray QgsOgrProvider::quotedIdentifier( QByteArray field ) const

void QgsOgrProvider::forceReload()
{
QgsOgrConnPool::instance()->invalidateConnections( filePath() );
QgsOgrConnPool::instance()->invalidateConnections( dataSourceUri() );
}

QByteArray QgsOgrProviderUtils::quotedIdentifier( QByteArray field, const QString& ogrDriverName )
@@ -2739,7 +2739,7 @@ bool QgsOgrProvider::syncToDisc()
{
shapeIndex = true;
close();
QgsOgrConnPool::instance()->invalidateConnections( mFilePath );
QgsOgrConnPool::instance()->invalidateConnections( dataSourceUri() );
QFile::remove( sbnIndexFile );
open();
}
@@ -2755,7 +2755,7 @@ bool QgsOgrProvider::syncToDisc()

mShapefileMayBeCorrupted = false;

QgsOgrConnPool::instance()->ref( mFilePath );
QgsOgrConnPool::instance()->ref( dataSourceUri() );
if ( shapeIndex )
{
return createSpatialIndex();
@@ -2805,7 +2805,7 @@ void QgsOgrProvider::recalculateFeatureCount()
OGR_L_SetSpatialFilter( ogrLayer, filter );
}

QgsOgrConnPool::instance()->invalidateConnections( filePath() );
QgsOgrConnPool::instance()->invalidateConnections( dataSourceUri() );
}

bool QgsOgrProvider::doesStrictFeatureTypeCheck() const

0 comments on commit ca74cc0

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