Skip to content

Commit

Permalink
Merge pull request #5290 from boundlessgeo/issue_16296_ddErrorInDbMan…
Browse files Browse the repository at this point in the history
…ager_2.18

[db_manager] d&d fix from spatialite and geopackage: fixes #16296
  • Loading branch information
elpaso authored Oct 11, 2017
2 parents da858ee + 5fcba06 commit 5231ef6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/plugins/db_manager/db_plugins/gpkg/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions python/plugins/db_manager/db_plugins/spatialite/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
* *
***************************************************************************/
"""

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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 5231ef6

Please sign in to comment.