[QGIS Commit] r13397 - trunk/qgis/src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Apr 26 18:30:17 EDT 2010


Author: jef
Date: 2010-04-26 18:30:16 -0400 (Mon, 26 Apr 2010)
New Revision: 13397

Modified:
   trunk/qgis/src/core/qgsproject.cpp
Log:
fix relative paths, when project is on unc path

Modified: trunk/qgis/src/core/qgsproject.cpp
===================================================================
--- trunk/qgis/src/core/qgsproject.cpp	2010-04-26 21:24:50 UTC (rev 13396)
+++ trunk/qgis/src/core/qgsproject.cpp	2010-04-26 22:30:16 UTC (rev 13397)
@@ -1334,6 +1334,7 @@
   {
 #if defined(Q_OS_WIN)
     if ( src.startsWith( "\\\\" ) ||
+         src.startsWith( "//" ) ||
          ( src[0].isLetter() && src[1] == ':' ) )
     {
       // UNC or absolute path
@@ -1371,11 +1372,21 @@
 #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();
 



More information about the QGIS-commit mailing list