mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
support relative paths for gpx datasources (fixes #11131)
This commit is contained in:
parent
c8a76f8c5c
commit
e1ff0edfba
@ -191,6 +191,12 @@ bool QgsMapLayer::readLayerXML( const QDomElement& layerElement )
|
||||
theURIParts[0] = QgsProject::instance()->readPath( theURIParts[0] );
|
||||
mDataSource = theURIParts.join( "|" );
|
||||
}
|
||||
else if ( provider == "gpx" )
|
||||
{
|
||||
QStringList theURIParts = mDataSource.split( "?" );
|
||||
theURIParts[0] = QgsProject::instance()->readPath( theURIParts[0] );
|
||||
mDataSource = theURIParts.join( "?" );
|
||||
}
|
||||
else if ( provider == "delimitedtext" )
|
||||
{
|
||||
QUrl urlSource = QUrl::fromEncoded( mDataSource.toAscii() );
|
||||
@ -466,6 +472,12 @@ bool QgsMapLayer::writeLayerXML( QDomElement& layerElement, QDomDocument& docume
|
||||
theURIParts[0] = QgsProject::instance()->writePath( theURIParts[0], relativeBasePath );
|
||||
src = theURIParts.join( "|" );
|
||||
}
|
||||
else if ( vlayer && vlayer->providerType() == "gpx" )
|
||||
{
|
||||
QStringList theURIParts = src.split( "?" );
|
||||
theURIParts[0] = QgsProject::instance()->writePath( theURIParts[0], relativeBasePath );
|
||||
src = theURIParts.join( "?" );
|
||||
}
|
||||
else if ( vlayer && vlayer->providerType() == "delimitedtext" )
|
||||
{
|
||||
QUrl urlSource = QUrl::fromEncoded( src.toAscii() );
|
||||
@ -1066,6 +1078,11 @@ QString QgsMapLayer::saveNamedStyle( const QString &theURI, bool &theResultFlag
|
||||
QStringList theURIParts = theURI.split( "|" );
|
||||
filename = theURIParts[0];
|
||||
}
|
||||
else if ( vlayer && vlayer->providerType() == "gpx" )
|
||||
{
|
||||
QStringList theURIParts = theURI.split( "?" );
|
||||
filename = theURIParts[0];
|
||||
}
|
||||
else if ( vlayer && vlayer->providerType() == "delimitedtext" )
|
||||
{
|
||||
filename = QUrl::fromEncoded( theURI.toAscii() ).toLocalFile();
|
||||
@ -1244,6 +1261,11 @@ QString QgsMapLayer::saveSldStyle( const QString &theURI, bool &theResultFlag )
|
||||
QStringList theURIParts = theURI.split( "|" );
|
||||
filename = theURIParts[0];
|
||||
}
|
||||
else if ( vlayer->providerType() == "gpx" )
|
||||
{
|
||||
QStringList theURIParts = theURI.split( "?" );
|
||||
filename = theURIParts[0];
|
||||
}
|
||||
else if ( vlayer->providerType() == "delimitedtext" )
|
||||
{
|
||||
filename = QUrl::fromEncoded( theURI.toAscii() ).toLocalFile();
|
||||
|
Loading…
x
Reference in New Issue
Block a user