From 32096f5b18bcd5df8d1fcd0ad9a3935a1430609c Mon Sep 17 00:00:00 2001 From: jef Date: Mon, 26 Apr 2010 22:30:16 +0000 Subject: [PATCH] fix relative paths, when project is on unc path git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13397 c8812cc2-4d05-0410-92ff-de0c093fc19c --- src/core/qgsproject.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/core/qgsproject.cpp b/src/core/qgsproject.cpp index 078a1f2108be..a1bda9e7ca2f 100644 --- a/src/core/qgsproject.cpp +++ b/src/core/qgsproject.cpp @@ -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();