Skip to content

Commit d8df19b

Browse files
alexbruynyalldawson
authored andcommittedMay 27, 2019
use data provider to get provider name as providerType() not available
in the LTR branch
1 parent 3b12f27 commit d8df19b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎src/core/qgsmaplayer.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -803,10 +803,11 @@ QString QgsMapLayer::baseURI( PropertyType type ) const
803803
// as in these cases URI may contain layer name and/or additional
804804
// information. This also strips prefix in case if VSIFILE mechanism
805805
// is used
806-
if ( providerType() == QLatin1String( "ogr" ) || providerType() == QLatin1String( "delimitedtext" ) ||
807-
providerType() == QLatin1String( "spatialite" ) )
806+
QString providerType = dataProvider()->name();
807+
if ( providerType == QLatin1String( "ogr" ) || providerType == QLatin1String( "delimitedtext" ) ||
808+
providerType == QLatin1String( "spatialite" ) )
808809
{
809-
QVariantMap components = QgsProviderRegistry::instance()->decodeUri( providerType(), myURI );
810+
QVariantMap components = QgsProviderRegistry::instance()->decodeUri( providerType, myURI );
810811
myURI = components["path"].toString();
811812
}
812813

0 commit comments

Comments
 (0)
Please sign in to comment.