Skip to content

Commit

Permalink
use data provider to get provider name as providerType() not available
Browse files Browse the repository at this point in the history
in the LTR branch
  • Loading branch information
alexbruy authored and nyalldawson committed May 27, 2019
1 parent 3b12f27 commit d8df19b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/qgsmaplayer.cpp
Expand Up @@ -803,10 +803,11 @@ QString QgsMapLayer::baseURI( PropertyType type ) const
// as in these cases URI may contain layer name and/or additional
// information. This also strips prefix in case if VSIFILE mechanism
// is used
if ( providerType() == QLatin1String( "ogr" ) || providerType() == QLatin1String( "delimitedtext" ) ||
providerType() == QLatin1String( "spatialite" ) )
QString providerType = dataProvider()->name();
if ( providerType == QLatin1String( "ogr" ) || providerType == QLatin1String( "delimitedtext" ) ||
providerType == QLatin1String( "spatialite" ) )
{
QVariantMap components = QgsProviderRegistry::instance()->decodeUri( providerType(), myURI );
QVariantMap components = QgsProviderRegistry::instance()->decodeUri( providerType, myURI );
myURI = components["path"].toString();
}

Expand Down

0 comments on commit d8df19b

Please sign in to comment.