mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-11-04 00:04:25 -05:00 
			
		
		
		
	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:
		
							parent
							
								
									a53296cb05
								
							
						
					
					
						commit
						bfe16a904c
					
				@ -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();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user