Skip to content
Permalink
Browse files
Use decodeUri to make bad layers file parsing more stable
  • Loading branch information
nyalldawson committed Sep 28, 2018
1 parent 0396abf commit e433a105677b67c5b6f5a5d49ff0397db2dd9229
Showing with 2 additions and 16 deletions.
  1. +2 −16 src/app/qgshandlebadlayers.cpp
@@ -176,27 +176,13 @@ QString QgsHandleBadLayers::filename( int row )

if ( type == QLatin1String( "vector" ) )
{
if ( provider == QLatin1String( "spatialite" ) )
{
QgsDataSourceUri uri( datasource );
return uri.database();
}
else if ( provider == QLatin1String( "ogr" ) )
{
QStringList theURIParts = datasource.split( '|' );
return theURIParts[0];
}
else if ( provider == QLatin1String( "delimitedtext" ) )
{
return QUrl::fromEncoded( datasource.toLatin1() ).toLocalFile();
}
const QVariantMap parts = QgsProviderRegistry::instance()->decodeUri( provider, datasource );
return parts.value( QLatin1String( "path" ) ).toString();
}
else
{
return datasource;
}

return QString();
}

void QgsHandleBadLayers::setFilename( int row, const QString &filename )

0 comments on commit e433a10

Please sign in to comment.