Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,8 @@ inline QString qgsConnectionPool_ConnectionToName( QgsOgrConn* c )
35
35
inline void qgsConnectionPool_ConnectionCreate ( QString connInfo, QgsOgrConn*& c )
36
36
{
37
37
c = new QgsOgrConn;
38
- c->ds = OGROpen ( connInfo.toUtf8 ().constData (), false , nullptr );
38
+ QString filePath = connInfo.left ( connInfo.indexOf ( " |" ) );
39
+ c->ds = OGROpen ( filePath.toUtf8 ().constData (), false , nullptr );
39
40
c->path = connInfo;
40
41
c->valid = true ;
41
42
}
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ QgsOgrFeatureIterator::QgsOgrFeatureIterator( QgsOgrFeatureSource* source, bool
44
44
{
45
45
mFeatureFetched = false ;
46
46
47
- mConn = QgsOgrConnPool::instance ()->acquireConnection ( mSource ->mFilePath );
47
+ mConn = QgsOgrConnPool::instance ()->acquireConnection ( mSource ->mProvider -> dataSourceUri () );
48
48
49
49
if ( mSource ->mLayerName .isNull () )
50
50
{
@@ -348,20 +348,20 @@ bool QgsOgrFeatureIterator::readFeature( OGRFeatureH fet, QgsFeature& feature )
348
348
QgsOgrFeatureSource::QgsOgrFeatureSource ( const QgsOgrProvider* p )
349
349
: mProvider( p )
350
350
{
351
- mFilePath = p->filePath ();
351
+ mDataSource = p->dataSourceUri ();
352
352
mLayerName = p->layerName ();
353
353
mLayerIndex = p->layerIndex ();
354
354
mSubsetString = p->mSubsetString ;
355
355
mEncoding = p->mEncoding ; // no copying - this is a borrowed pointer from Qt
356
356
mFields = p->mAttributeFields ;
357
357
mDriverName = p->ogrDriverName ;
358
358
mOgrGeometryTypeFilter = wkbFlatten ( p->mOgrGeometryTypeFilter );
359
- QgsOgrConnPool::instance ()->ref ( mFilePath );
359
+ QgsOgrConnPool::instance ()->ref ( mDataSource );
360
360
}
361
361
362
362
QgsOgrFeatureSource::~QgsOgrFeatureSource ()
363
363
{
364
- QgsOgrConnPool::instance ()->unref ( mFilePath );
364
+ QgsOgrConnPool::instance ()->unref ( mDataSource );
365
365
}
366
366
367
367
QgsFeatureIterator QgsOgrFeatureSource::getFeatures ( const QgsFeatureRequest& request )
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ class QgsOgrFeatureSource : public QgsAbstractFeatureSource
34
34
35
35
protected:
36
36
const QgsOgrProvider* mProvider ;
37
- QString mFilePath ;
37
+ QString mDataSource ;
38
38
QString mLayerName ;
39
39
int mLayerIndex ;
40
40
QString mSubsetString ;
0 commit comments