Skip to content
Permalink
Browse files

Always use / for dir separator with QFileInfo. Fixes #1864

git-svn-id: http://svn.osgeo.org/qgis/trunk@11360 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
homann
homann committed Aug 12, 2009
1 parent e5d7309 commit 9d7d1a7ab2e2f580731595394ca880453f272c74
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/core/qgsmaplayer.cpp
@@ -287,9 +287,12 @@ bool QgsMapLayer::writeXML( QDomNode & layer_node, QDomDocument & document )
{
QFileInfo pfi( QgsProject::instance()->fileName() );
QgsDebugMsg( "project path: " + pfi.canonicalPath() );
QgsDebugMsg( "src path: " + srcInfo.canonicalFilePath() + QDir::separator() );
if ( srcInfo.canonicalFilePath().startsWith( pfi.canonicalPath() + QDir::separator() ) )
QgsDebugMsg( "src path: " + srcInfo.canonicalFilePath() );
if ( srcInfo.canonicalFilePath().startsWith( pfi.canonicalPath() + "/" ) ) // QFileInfo always uses '/' for directory separator.
{
src = src.mid( pfi.canonicalPath().size() + 1 );
QgsDebugMsg( "use relative path: " + src );
}
}

QDomText dataSourceText = document.createTextNode( src );

0 comments on commit 9d7d1a7

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