Skip to content

Commit

Permalink
cleanup of deprecation warnings for QGIS 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Régis Haubourg committed Jan 7, 2015
1 parent 1641fe8 commit 54edb2a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 42 deletions.
47 changes: 5 additions & 42 deletions EasyCustomLabeling/EasyCustomLabeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ def initGui(self):

def labelLayerChecked(self):


# print 'project loaded. labelLayerchecked triggered '
# Checks if some labeling layers are already there, and replug, if not already labelLayerModified events

Expand Down Expand Up @@ -166,45 +165,7 @@ def labelLayerChecked(self):
# print 'reloading memory layer data '


# LblXok = False
# LblYok = False
# LblAlignHok= False
# LblAlignVok= False
# LblShowCOok= False
# LblShowok= False

# print dp.fields()
# print dp.fieldNameMap()
# print '| before : fieldnamemap should not be empty !. If reload easycustomlabeling, this is not empty anymore. WHY?'
# # for f in dp.fields():
# for f in dp.fieldNameMap():
# # print f.name()
# print f
# if f == 'LblX':
# LblXok = True
# print 'LblXok'
# elif f == 'LblY':
# LblYok = True
# print 'LblYok'
# elif f == 'LblAlignH':
# LblAlignHok = True
# print 'LblAlignHok'
# elif f == 'LblAlignV':
# LblAlignVok = True
# print 'LblAlignVok'
# elif f == 'LblShowCO':
# LblShowCOok = True
# print 'LblShowCOok'
# elif f == 'LblShow':
# LblShowok = True
# print 'LblShowok'

# if LblXok and LblYok and LblAlignHok and LblAlignVok and LblShowCOok and LblShowok :
# print '-- label layer connecting attributeValueChanged to labelLayerModified '




# @pyqtSlot(int, int, str)
def labelLayerModified(self, FeatureId, idx, variant):
sender = self.sender()
Expand Down Expand Up @@ -639,9 +600,9 @@ def runLabel(self):
labelLayer.attributeValueChanged.connect(self.labelLayerModified)

#redraws registry and mapcanvas.
if hasattr(labelMapLayer, "setCacheImage" ):
if hasattr(labelMapLayer, "setCacheImage" ) and QGis.QGIS_VERSION_INT < 20600:
labelMapLayer.setCacheImage(None )

labelMapLayer.triggerRepaint()
self.iface.legendInterface().refreshLayerSymbology( labelMapLayer )
self.iface.actionToggleEditing().trigger()
Expand All @@ -655,7 +616,9 @@ def runLabel(self):
raise

finally :
QgsMapLayerRegistry.instance().clearAllLayerCaches () #clean cache to allow mask layer to appear on refresh
if QGis.QGIS_VERSION_INT < 20600:
QgsMapLayerRegistry.instance().clearAllLayerCaches () #clean cache to allow mask layer to appear on refresh

# if sourceLayer and not keepUserSelection :
# sourceLayer.removeSelection()

Expand Down
Binary file modified EasyCustomLabeling/EasyCustomLabeling.pyc
Binary file not shown.

0 comments on commit 54edb2a

Please sign in to comment.