Skip to content

Commit

Permalink
Merge pull request #2620 from SebDieBln/FixCsvSaveStyle
Browse files Browse the repository at this point in the history
Fix saving style of CSV-layer to qml/sld file (fixes #8285)
  • Loading branch information
jef-n committed Dec 28, 2015
2 parents 416c004 + 02e9272 commit b737850
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/qgsmaplayer.cpp
Original file line number Diff line number Diff line change
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 b737850

Please sign in to comment.