Skip to content
Permalink
Browse files

fix Python error when unloading the OSM plugin

git-svn-id: http://svn.osgeo.org/qgis/trunk@14545 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
borysiasty
borysiasty committed Nov 11, 2010
1 parent 404d0ae commit 137298525da318efe37105eaad7586c2e53dc323
Showing with 7 additions and 0 deletions.
  1. +6 −0 python/plugins/osm/OsmDatabaseManager.py
  2. +1 −0 python/plugins/osm/OsmPlugin.py
@@ -55,6 +55,12 @@ def __init__(self,plugin):
QObject.connect(QgsMapLayerRegistry.instance(),SIGNAL("layerWillBeRemoved(QString)"),self.layerRemoved)


def disconnectSignals(self):
# disconnect layer changes signals
QObject.disconnect(self.plugin.iface,SIGNAL("currentLayerChanged(QgsMapLayer*)"),self.currLayerChanged)
QObject.disconnect(QgsMapLayerRegistry.instance(),SIGNAL("layerWillBeRemoved(QString)"),self.layerRemoved)


def currLayerChanged(self,layer):
"""Function is called after currentLayerChanged(QgsMapLayer*) signal is emitted.
@@ -147,6 +147,7 @@ def unload(self):
"""Function unloads the OSM Plugin.
"""

self.dbm.disconnectSignals()
self.canvas.unsetMapTool(self.dockWidget.mapTool)
del self.dockWidget.mapTool
self.dockWidget.mapTool=None

0 comments on commit 1372985

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