Skip to content
Permalink
Browse files

[processing] fix deprecation warnings

  • Loading branch information
alexbruy committed Jan 20, 2016
1 parent 3b70b84 commit 908a3802412e314205c34ae832ae151fd02ab365
@@ -453,7 +453,7 @@ def exportVectorLayer(self, orgFilename):

def setSessionProjectionFromProject(self, commands):
if not GrassUtils.projectionSet:
proj4 = iface.mapCanvas().mapRenderer().destinationCrs().toProj4()
proj4 = iface.mapCanvas().mapSettings().destinationCrs().toProj4()
command = 'g.proj'
command += ' -c'
command += ' proj4="' + proj4 + '"'
@@ -513,7 +513,7 @@ def exportVectorLayer(self, orgFilename):

def setSessionProjectionFromProject(self, commands):
if not Grass7Utils.projectionSet:
proj4 = iface.mapCanvas().mapRenderer().destinationCrs().toProj4()
proj4 = iface.mapCanvas().mapSettings().destinationCrs().toProj4()
command = 'g.proj'
command += ' -c'
command += ' proj4="' + proj4 + '"'
@@ -95,7 +95,7 @@ def processAlgorithm(self, progress):
'NONE')[0]
crs = layer.crs().srsid()
elif method == 1:
mapCRS = iface.mapCanvas().mapRenderer().destinationCrs()
mapCRS = iface.mapCanvas().mapSettings().destinationCrs()
layCRS = layer.crs()
coordTransform = QgsCoordinateTransform(layCRS, mapCRS)

@@ -385,7 +385,7 @@ def setOutputCRS(self):
return
try:
from qgis.utils import iface
self.crs = iface.mapCanvas().mapRenderer().destinationCrs()
self.crs = iface.mapCanvas().mapSettings().destinationCrs()
except:
pass

@@ -161,7 +161,7 @@ def useLayerExtent(self):
CANVAS_KEY = 'Use canvas extent'
extentsDict = {}
extentsDict[CANVAS_KEY] = {"extent": iface.mapCanvas().extent(),
"authid": iface.mapCanvas().mapRenderer().destinationCrs().authid()}
"authid": iface.mapCanvas().mapSettings().destinationCrs().authid()}
extents = [CANVAS_KEY]
layers = dataobjects.getAllLayers()
for layer in layers:
@@ -177,7 +177,7 @@ def useLayerExtent(self):
self.tr('Use extent from'), extents, False)
if ok:
self.setValueFromRect(extentsDict[item]["extent"])
if extentsDict[item]["authid"] != iface.mapCanvas().mapRenderer().destinationCrs().authid():
if extentsDict[item]["authid"] != iface.mapCanvas().mapSettings().destinationCrs().authid():
iface.messageBar().pushMessage(self.tr("Warning"),
self.tr("The projection of the chosen layer is not the same as canvas projection! The selected extent might not be what was intended."),
QgsMessageBar.WARNING, 8)
@@ -95,5 +95,3 @@ def calculateStep(self, minimum, maximum):
return round(step, -int(floor(log10(step))))
else:
return 1.0


0 comments on commit 908a380

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