Skip to content

Commit

Permalink
Always use / for dir separator with QFileInfo. Fixes #1864
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@11360 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
homann committed Aug 12, 2009
1 parent e5d7309 commit 9d7d1a7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/qgsmaplayer.cpp
Expand Up @@ -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 );
Expand Down

0 comments on commit 9d7d1a7

Please sign in to comment.