Skip to content

Commit

Permalink
fix saving style of CSV-layer to qml/sld file (fixes #8285)
Browse files Browse the repository at this point in the history
  • Loading branch information
SebDieBln committed Dec 28, 2015
1 parent 573a4b7 commit 02e9272
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/qgsmaplayer.cpp
Expand Up @@ -1269,6 +1269,9 @@ QString QgsMapLayer::saveNamedStyle( const QString &theURI, bool &theResultFlag
else if ( vlayer && vlayer->providerType() == "delimitedtext" )
{
filename = QUrl::fromEncoded( theURI.toAscii() ).toLocalFile();
// toLocalFile() returns an empty string if theURI is a plain Windows-path, e.g. "C:/style.qml"
if ( filename.isEmpty() )
filename = theURI;
}
else
{
Expand Down Expand Up @@ -1453,6 +1456,9 @@ QString QgsMapLayer::saveSldStyle( const QString &theURI, bool &theResultFlag )
else if ( vlayer->providerType() == "delimitedtext" )
{
filename = QUrl::fromEncoded( theURI.toAscii() ).toLocalFile();
// toLocalFile() returns an empty string if theURI is a plain Windows-path, e.g. "C:/style.qml"
if ( filename.isEmpty() )
filename = theURI;
}
else
{
Expand Down

0 comments on commit 02e9272

Please sign in to comment.