Skip to content
Permalink
Browse files

fixed mimeUri x Spatialite and Geopackage. fixes #16296

  • Loading branch information
luipir committed Oct 3, 2017
1 parent 82dcc68 commit 378ab23f4d8b2fc683d8d4f075aeae695c44bf8c
@@ -19,6 +19,8 @@
* *
***************************************************************************/
"""
import re

from builtins import str

# this will disable the dbplugin if the connector raise an ImportError
@@ -189,7 +191,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, re.sub(":", "\:", self.ogrUri()))

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

# this will disable the dbplugin if the connector raise an ImportError
from .connector import SpatiaLiteDBConnector
@@ -183,7 +184,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, re.sub(":", "\:", self.uri().uri(False)))

def toMapLayer(self):
from qgis.core import QgsVectorLayer
@@ -268,7 +270,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, re.sub(":", "\:", self.uri().database()))
return uri

def toMapLayer(self):

0 comments on commit 378ab23

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