mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-07 00:05:28 -04:00
fix build error on windows
git-svn-id: http://svn.osgeo.org/qgis/trunk@14479 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
5ec236c4d9
commit
4447ea58d1
@ -483,7 +483,7 @@ void QgsApplication::registerOgrDrivers()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QgsApplication::absolutePathToRelativePath( const QString& apath, const QString& targetPath )
|
QString QgsApplication::absolutePathToRelativePath( QString aPath, QString targetPath )
|
||||||
{
|
{
|
||||||
#if defined( Q_OS_WIN )
|
#if defined( Q_OS_WIN )
|
||||||
const Qt::CaseSensitivity cs = Qt::CaseInsensitive;
|
const Qt::CaseSensitivity cs = Qt::CaseInsensitive;
|
||||||
@ -506,7 +506,7 @@ QString QgsApplication::absolutePathToRelativePath( const QString& apath, const
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
QStringList targetElems = targetPath.split( "/", QString::SkipEmptyParts );
|
QStringList targetElems = targetPath.split( "/", QString::SkipEmptyParts );
|
||||||
QStringList aPathElems = apath.split( "/", QString::SkipEmptyParts );
|
QStringList aPathElems = aPath.split( "/", QString::SkipEmptyParts );
|
||||||
|
|
||||||
targetElems.removeAll( "." );
|
targetElems.removeAll( "." );
|
||||||
aPathElems.removeAll( "." );
|
aPathElems.removeAll( "." );
|
||||||
@ -524,8 +524,8 @@ QString QgsApplication::absolutePathToRelativePath( const QString& apath, const
|
|||||||
|
|
||||||
if ( n == 0 )
|
if ( n == 0 )
|
||||||
{
|
{
|
||||||
// no common parts; might not even by a file
|
// no common parts; might not even be a file
|
||||||
return apath;
|
return aPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( targetElems.size() > 0 )
|
if ( targetElems.size() > 0 )
|
||||||
@ -546,7 +546,7 @@ QString QgsApplication::absolutePathToRelativePath( const QString& apath, const
|
|||||||
return aPathElems.join( "/" );
|
return aPathElems.join( "/" );
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QgsApplication::relativePathToAbsolutePath( const QString& rpath, const QString& targetPath )
|
QString QgsApplication::relativePathToAbsolutePath( QString rpath, QString targetPath )
|
||||||
{
|
{
|
||||||
// relative path should always start with ./ or ../
|
// relative path should always start with ./ or ../
|
||||||
if ( !rpath.startsWith( "./" ) && !rpath.startsWith( "../" ) )
|
if ( !rpath.startsWith( "./" ) && !rpath.startsWith( "../" ) )
|
||||||
@ -555,7 +555,7 @@ QString QgsApplication::relativePathToAbsolutePath( const QString& rpath, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
rPath.replace( "\\", "/" );
|
rpath.replace( "\\", "/" );
|
||||||
targetPath.replace( "\\", "/" );
|
targetPath.replace( "\\", "/" );
|
||||||
|
|
||||||
bool uncPath = targetPath.startsWith( "//" );
|
bool uncPath = targetPath.startsWith( "//" );
|
||||||
|
@ -194,10 +194,10 @@ class CORE_EXPORT QgsApplication: public QApplication
|
|||||||
|
|
||||||
/**Converts absolute path to path relative to target
|
/**Converts absolute path to path relative to target
|
||||||
@note: this method was added in version 1.6*/
|
@note: this method was added in version 1.6*/
|
||||||
static QString absolutePathToRelativePath( const QString& apath, const QString& targetPath );
|
static QString absolutePathToRelativePath( QString apath, QString targetPath );
|
||||||
/**Converts path relative to target to an absolute path
|
/**Converts path relative to target to an absolute path
|
||||||
@note: this method was added in version 1.6*/
|
@note: this method was added in version 1.6*/
|
||||||
static QString relativePathToAbsolutePath( const QString& rpath, const QString& targetPath );
|
static QString relativePathToAbsolutePath( QString rpath, QString targetPath );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static QString mPrefixPath;
|
static QString mPrefixPath;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user