Skip to content

Commit 1ab8716

Browse files
committedAug 16, 2018
Implement decodeUri for the delimited text & spatialite providers
1 parent 45b209c commit 1ab8716

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
 

‎src/providers/delimitedtext/qgsdelimitedtextprovider.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,13 @@ QString QgsDelimitedTextProvider::description() const
11351135
return TEXT_PROVIDER_DESCRIPTION;
11361136
}
11371137

1138+
QGISEXTERN QVariantMap decodeUri( const QString &uri )
1139+
{
1140+
QVariantMap components;
1141+
components.insert( QStringLiteral( "path" ), QUrl( uri ).toLocalFile() );
1142+
return components;
1143+
}
1144+
11381145
/**
11391146
* Class factory to return a pointer to a newly created
11401147
* QgsDelimitedTextProvider object

‎src/providers/spatialite/qgsspatialiteprovider.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5294,6 +5294,16 @@ void QgsSpatiaLiteProvider::invalidateConnections( const QString &connection )
52945294
QgsSpatiaLiteConnPool::instance()->invalidateConnections( connection );
52955295
}
52965296

5297+
QGISEXTERN QVariantMap decodeUri( const QString &uri )
5298+
{
5299+
QgsDataSourceUri dsUri = QgsDataSourceUri( uri );
5300+
5301+
QVariantMap components;
5302+
components.insert( QStringLiteral( "path" ), dsUri.database() );
5303+
components.insert( QStringLiteral( "layerName" ), dsUri.table() );
5304+
return components;
5305+
}
5306+
52975307
/**
52985308
* Class factory to return a pointer to a newly created
52995309
* QgsSpatiaLiteProvider object

0 commit comments

Comments
 (0)
Please sign in to comment.