Oslandia / albion

Migrated to: https://gitlab.com/Oslandia/albion
https://gitlab.com/Oslandia/albion
GNU General Public License v3.0
49 stars 17 forks source link

Python traceback when you click on the 'axis' button in the canvas 'section' #21

Closed garaud closed 6 years ago

garaud commented 7 years ago

You can see the X,Y axis on the main canvas and the canvas 'section'. A layer is added to the layer group 'section' with the name axis plugin layer. But you get this following traceback:

Traceback (most recent call last):
  File "/home/username/.qgis2/python/plugins/albion/plugin.py", line 134, in __layers_added
    layer.editCommandEnded.connect(self.__update_projection_if_needed)
AttributeError: 'AxisLayer' object has no attribute 'editCommandEnded'

When you select it in the layer view, you get:

Traceback (most recent call last):
  File "/home/username/.qgis2/python/plugins/albion/action_state_helper.py", line 29, in update_all
    h.update_state()
  File "/home/username/.qgis2/python/plugins/albion/action_state_helper.py", line 17, in update_state
    enabled, tooltip = test(self.action)
  File "/home/username/.qgis2/python/plugins/albion/section_toolbar.py", line 62, in 
    lambda action: (layer_has_z(iface.mapCanvas().currentLayer()),
  File "/home/username/.qgis2/python/plugins/albion/qgis_hal.py", line 31, in layer_has_z
    for feat in layer.getFeatures():
AttributeError: 'AxisLayer' object has no attribute 'getFeatures'

And when you want to remove it:

Traceback (most recent call last):
  File "/home/username/.qgis2/python/plugins/albion/plugin.py", line 139, in __layers_will_be_removed
    get_layer_by_id(layer_id).editCommandEnded.\
AttributeError: 'AxisLayer' object has no attribute 'editCommandEnded'
peppsac commented 7 years ago

Thanks for the bug report. This should be fixed by e7bc4a2