@@ -191,6 +191,12 @@ bool QgsMapLayer::readLayerXML( const QDomElement& layerElement )
191
191
theURIParts[0 ] = QgsProject::instance ()->readPath ( theURIParts[0 ] );
192
192
mDataSource = theURIParts.join ( " |" );
193
193
}
194
+ else if ( provider == " gpx" )
195
+ {
196
+ QStringList theURIParts = mDataSource .split ( " ?" );
197
+ theURIParts[0 ] = QgsProject::instance ()->readPath ( theURIParts[0 ] );
198
+ mDataSource = theURIParts.join ( " ?" );
199
+ }
194
200
else if ( provider == " delimitedtext" )
195
201
{
196
202
QUrl urlSource = QUrl::fromEncoded ( mDataSource .toAscii () );
@@ -466,6 +472,12 @@ bool QgsMapLayer::writeLayerXML( QDomElement& layerElement, QDomDocument& docume
466
472
theURIParts[0 ] = QgsProject::instance ()->writePath ( theURIParts[0 ], relativeBasePath );
467
473
src = theURIParts.join ( " |" );
468
474
}
475
+ else if ( vlayer && vlayer->providerType () == " gpx" )
476
+ {
477
+ QStringList theURIParts = src.split ( " ?" );
478
+ theURIParts[0 ] = QgsProject::instance ()->writePath ( theURIParts[0 ], relativeBasePath );
479
+ src = theURIParts.join ( " ?" );
480
+ }
469
481
else if ( vlayer && vlayer->providerType () == " delimitedtext" )
470
482
{
471
483
QUrl urlSource = QUrl::fromEncoded ( src.toAscii () );
@@ -1066,6 +1078,11 @@ QString QgsMapLayer::saveNamedStyle( const QString &theURI, bool &theResultFlag
1066
1078
QStringList theURIParts = theURI.split ( " |" );
1067
1079
filename = theURIParts[0 ];
1068
1080
}
1081
+ else if ( vlayer && vlayer->providerType () == " gpx" )
1082
+ {
1083
+ QStringList theURIParts = theURI.split ( " ?" );
1084
+ filename = theURIParts[0 ];
1085
+ }
1069
1086
else if ( vlayer && vlayer->providerType () == " delimitedtext" )
1070
1087
{
1071
1088
filename = QUrl::fromEncoded ( theURI.toAscii () ).toLocalFile ();
@@ -1244,6 +1261,11 @@ QString QgsMapLayer::saveSldStyle( const QString &theURI, bool &theResultFlag )
1244
1261
QStringList theURIParts = theURI.split ( " |" );
1245
1262
filename = theURIParts[0 ];
1246
1263
}
1264
+ else if ( vlayer->providerType () == " gpx" )
1265
+ {
1266
+ QStringList theURIParts = theURI.split ( " ?" );
1267
+ filename = theURIParts[0 ];
1268
+ }
1247
1269
else if ( vlayer->providerType () == " delimitedtext" )
1248
1270
{
1249
1271
filename = QUrl::fromEncoded ( theURI.toAscii () ).toLocalFile ();
0 commit comments