Skip to content
Permalink
Browse files

adapted to 3.4 API

  • Loading branch information
luipir committed Feb 12, 2019
1 parent 6d5d7c5 commit 754b2e76ea91ad160014b60d29ab37a37237cdb3
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/core/qgsmaplayer.cpp
@@ -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"

0 comments on commit 754b2e7

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