fix relative paths, when project is on unc path

git-svn-id: http://svn.osgeo.org/qgis/trunk@13397 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
jef 2010-04-26 22:30:16 +00:00
parent a53296cb05
commit bfe16a904c

View File

@ -1334,6 +1334,7 @@ QString QgsProject::readPath( QString src ) const
{
#if defined(Q_OS_WIN)
if ( src.startsWith( "\\\\" ) ||
src.startsWith( "//" ) ||
( src[0].isLetter() && src[1] == ':' ) )
{
// UNC or absolute path
@ -1371,11 +1372,21 @@ QString QgsProject::readPath( QString src ) const
#if defined(Q_OS_WIN)
srcPath.replace( "\\", "/" );
projPath.replace( "\\", "/" );
bool uncPath = projPath.startsWith( "//" );
#endif
QStringList srcElems = srcPath.split( "/", QString::SkipEmptyParts );
QStringList projElems = projPath.split( "/", QString::SkipEmptyParts );
#if defined(Q_OS_WIN)
if ( uncPath )
{
projElems.insert( 0, "" );
projElems.insert( 0, "" );
}
#endif
// remove project file element
projElems.removeLast();