Skip to content
Permalink
Browse files

Merge pull request #5290 from boundlessgeo/issue_16296_ddErrorInDbMan…

…ager_2.18

[db_manager] d&d fix from spatialite and geopackage: fixes #16296
  • Loading branch information
elpaso committed Oct 11, 2017
2 parents da858ee + 5fcba06 commit 5231ef643da3ce09dfa7878f35c38979b6f6c172
@@ -189,7 +189,7 @@ def ogrUri(self):
def mimeUri(self):

# QGIS has no provider to load Geopackage vectors, let's use OGR
return u"vector:ogr:%s:%s" % (self.name, self.ogrUri())
return u"vector:ogr:%s:%s" % (self.name, self.ogrUri().replace(":", "\:"))

def toMapLayer(self):
from qgis.core import QgsVectorLayer
@@ -19,7 +19,6 @@
* *
***************************************************************************/
"""

# this will disable the dbplugin if the connector raise an ImportError
from .connector import SpatiaLiteDBConnector

@@ -183,7 +182,8 @@ def ogrUri(self):
return ogrUri

def mimeUri(self):
return Table.mimeUri(self)
layerType = "raster" if self.type == Table.RasterType else "vector"
return u"%s:%s:%s:%s" % (layerType, self.database().dbplugin().providerName(), self.name, self.uri().uri(False).replace(":", "\:"))

def toMapLayer(self):
from qgis.core import QgsVectorLayer
@@ -268,7 +268,7 @@ def rasterliteGdalUri(self):

def mimeUri(self):
# QGIS has no provider to load rasters, let's use GDAL
uri = u"raster:gdal:%s:%s" % (self.name, self.uri().database())
uri = u"raster:gdal:%s:%s" % (self.name, self.uri().database().replace(":", "\:"))
return uri

def toMapLayer(self):

0 comments on commit 5231ef6

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