mirror of
https://github.com/qgis/QGIS.git
synced 2025-11-15 00:06:49 -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 defined(Q_OS_WIN)
|
||||||
if ( src.startsWith( "\\\\" ) ||
|
if ( src.startsWith( "\\\\" ) ||
|
||||||
|
src.startsWith( "//" ) ||
|
||||||
( src[0].isLetter() && src[1] == ':' ) )
|
( src[0].isLetter() && src[1] == ':' ) )
|
||||||
{
|
{
|
||||||
// UNC or absolute path
|
// UNC or absolute path
|
||||||
@ -1371,11 +1372,21 @@ QString QgsProject::readPath( QString src ) const
|
|||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
srcPath.replace( "\\", "/" );
|
srcPath.replace( "\\", "/" );
|
||||||
projPath.replace( "\\", "/" );
|
projPath.replace( "\\", "/" );
|
||||||
|
|
||||||
|
bool uncPath = projPath.startsWith( "//" );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QStringList srcElems = srcPath.split( "/", QString::SkipEmptyParts );
|
QStringList srcElems = srcPath.split( "/", QString::SkipEmptyParts );
|
||||||
QStringList projElems = projPath.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
|
// remove project file element
|
||||||
projElems.removeLast();
|
projElems.removeLast();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user