Skip to content

Commit

Permalink
Implement decodeUri for the delimited text & spatialite providers
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Aug 16, 2018
1 parent 45b209c commit 1ab8716
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
Expand Up @@ -1135,6 +1135,13 @@ QString QgsDelimitedTextProvider::description() const
return TEXT_PROVIDER_DESCRIPTION;
}

QGISEXTERN QVariantMap decodeUri( const QString &uri )
{
QVariantMap components;
components.insert( QStringLiteral( "path" ), QUrl( uri ).toLocalFile() );
return components;
}

/**
* Class factory to return a pointer to a newly created
* QgsDelimitedTextProvider object
Expand Down
10 changes: 10 additions & 0 deletions src/providers/spatialite/qgsspatialiteprovider.cpp
Expand Up @@ -5294,6 +5294,16 @@ void QgsSpatiaLiteProvider::invalidateConnections( const QString &connection )
QgsSpatiaLiteConnPool::instance()->invalidateConnections( connection );
}

QGISEXTERN QVariantMap decodeUri( const QString &uri )
{
QgsDataSourceUri dsUri = QgsDataSourceUri( uri );

QVariantMap components;
components.insert( QStringLiteral( "path" ), dsUri.database() );
components.insert( QStringLiteral( "layerName" ), dsUri.table() );
return components;
}

/**
* Class factory to return a pointer to a newly created
* QgsSpatiaLiteProvider object
Expand Down

0 comments on commit 1ab8716

Please sign in to comment.