Skip to content
Permalink
Browse files

[processing] fix for import into spatialite and execute sql algorithms

  • Loading branch information
nirvn committed Nov 24, 2017
1 parent 03ec2d8 commit 1fcadb72ff3f2f9b008e395bd7ff11a9ffe053b2
@@ -84,7 +84,9 @@ def processAlgorithm(self, parameters, context, feedback):
databaseuri = database.dataProvider().dataSourceUri()
uri = QgsDataSourceUri(databaseuri)
if uri.database() is '':
if '|layerid' in databaseuri:
if '|layername' in databaseuri:
databaseuri = databaseuri[:databaseuri.find('|layername')]
elif '|layerid' in databaseuri:
databaseuri = databaseuri[:databaseuri.find('|layerid')]
uri = QgsDataSourceUri('dbname=\'%s\'' % (databaseuri))
db = spatialite.GeoDB(uri)
@@ -61,7 +61,9 @@ def processAlgorithm(self, parameters, context, feedback):
databaseuri = database.dataProvider().dataSourceUri()
uri = QgsDataSourceUri(databaseuri)
if uri.database() is '':
if '|layerid' in databaseuri:
if '|layername' in databaseuri:
databaseuri = databaseuri[:databaseuri.find('|layername')]
elif '|layerid' in databaseuri:
databaseuri = databaseuri[:databaseuri.find('|layerid')]
uri = QgsDataSourceUri('dbname=\'%s\'' % (databaseuri))
db = spatialite.GeoDB(uri)

0 comments on commit 1fcadb7

Please sign in to comment.
You can’t perform that action at this time.