Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Homogenize toMapLayer function definition
  • Loading branch information
nicogodet authored and nyalldawson committed Nov 7, 2021
1 parent 1484c46 commit ea981d8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion python/plugins/db_manager/db_plugins/gpkg/plugin.py
Expand Up @@ -308,7 +308,7 @@ def mimeUri(self):
uri = u"raster:gdal:%s:%s" % (self.name, self.uri().database())
return uri

def toMapLayer(self):
def toMapLayer(self, geometryType=None, crs=None):
from qgis.core import QgsRasterLayer, QgsContrastEnhancement

# QGIS has no provider to load rasters, let's use GDAL
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/db_manager/db_plugins/postgis/plugin.py
Expand Up @@ -378,7 +378,7 @@ def mimeUri(self):
uri = u"raster:postgresraster:{}:{}".format(self.name, re.sub(":", r"\:", self.uri()))
return uri

def toMapLayer(self):
def toMapLayer(self, geometryType=None, crs=None):
from qgis.core import QgsRasterLayer, QgsContrastEnhancement, QgsDataSourceUri, QgsCredentials

rl = QgsRasterLayer(self.uri(), self.name, "postgresraster")
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/db_manager/db_plugins/spatialite/plugin.py
Expand Up @@ -192,7 +192,7 @@ def ogrUri(self):
def mimeUri(self):
return Table.mimeUri(self)

def toMapLayer(self):
def toMapLayer(self, geometryType=None, crs=None):
from qgis.core import QgsVectorLayer

provider = self.database().dbplugin().providerName()
Expand Down Expand Up @@ -278,7 +278,7 @@ def mimeUri(self):
uri = u"raster:gdal:%s:%s" % (self.name, self.uri().database())
return uri

def toMapLayer(self):
def toMapLayer(self, geometryType=None, crs=None):
from qgis.core import QgsRasterLayer, QgsContrastEnhancement

# QGIS has no provider to load Rasterlite rasters, let's use GDAL
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/db_manager/db_plugins/vlayers/plugin.py
Expand Up @@ -185,7 +185,7 @@ def refreshTableEstimatedExtent(self):
def runAction(self, action):
return

def toMapLayer(self):
def toMapLayer(self, geometryType=None, crs=None):
return QgsProject.instance().mapLayer(self.geomTableName)


Expand Down

0 comments on commit ea981d8

Please sign in to comment.