Skip to content

Commit 32096f5

Browse files
author
jef
committed
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
1 parent 6eab254 commit 32096f5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/core/qgsproject.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,7 @@ QString QgsProject::readPath( QString src ) const
13341334
{
13351335
#if defined(Q_OS_WIN)
13361336
if ( src.startsWith( "\\\\" ) ||
1337+
src.startsWith( "//" ) ||
13371338
( src[0].isLetter() && src[1] == ':' ) )
13381339
{
13391340
// UNC or absolute path
@@ -1371,11 +1372,21 @@ QString QgsProject::readPath( QString src ) const
13711372
#if defined(Q_OS_WIN)
13721373
srcPath.replace( "\\", "/" );
13731374
projPath.replace( "\\", "/" );
1375+
1376+
bool uncPath = projPath.startsWith( "//" );
13741377
#endif
13751378

13761379
QStringList srcElems = srcPath.split( "/", QString::SkipEmptyParts );
13771380
QStringList projElems = projPath.split( "/", QString::SkipEmptyParts );
13781381

1382+
#if defined(Q_OS_WIN)
1383+
if ( uncPath )
1384+
{
1385+
projElems.insert( 0, "" );
1386+
projElems.insert( 0, "" );
1387+
}
1388+
#endif
1389+
13791390
// remove project file element
13801391
projElems.removeLast();
13811392

0 commit comments

Comments
 (0)