Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
adapted to 3.4 API
  • Loading branch information
luipir committed Feb 12, 2019
1 parent 6d5d7c5 commit 754b2e7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/qgsmaplayer.cpp
Expand Up @@ -1483,17 +1483,17 @@ QString QgsMapLayer::saveSldStyle( const QString &uri, bool &resultFlag ) const
// check if the uri is a file or ends with .sld,
// which indicates that it should become one
QString filename;
if ( mlayer->providerType() == QLatin1String( "ogr" ) )
if ( mlayer->dataProvider()->name() == QLatin1String( "ogr" ) )
{
QStringList theURIParts = uri.split( '|' );
filename = theURIParts[0];
}
else if ( mlayer->providerType() == QLatin1String( "gpx" ) )
else if ( mlayer->dataProvider()->name() == QLatin1String( "gpx" ) )
{
QStringList theURIParts = uri.split( '?' );
filename = theURIParts[0];
}
else if ( mlayer->providerType() == QLatin1String( "delimitedtext" ) )
else if ( mlayer->dataProvider()->name() == QLatin1String( "delimitedtext" ) )
{
filename = QUrl::fromEncoded( uri.toLatin1() ).toLocalFile();
// toLocalFile() returns an empty string if theURI is a plain Windows-path, e.g. "C:/style.qml"
Expand Down

0 comments on commit 754b2e7

Please sign in to comment.