[QGIS Commit] r14545 - trunk/qgis/python/plugins/osm

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Nov 11 13:36:09 EST 2010


Author: borysiasty
Date: 2010-11-11 10:36:08 -0800 (Thu, 11 Nov 2010)
New Revision: 14545

Modified:
   trunk/qgis/python/plugins/osm/OsmDatabaseManager.py
   trunk/qgis/python/plugins/osm/OsmPlugin.py
Log:
fix Python error when unloading the OSM plugin

Modified: trunk/qgis/python/plugins/osm/OsmDatabaseManager.py
===================================================================
--- trunk/qgis/python/plugins/osm/OsmDatabaseManager.py	2010-11-11 15:33:29 UTC (rev 14544)
+++ trunk/qgis/python/plugins/osm/OsmDatabaseManager.py	2010-11-11 18:36:08 UTC (rev 14545)
@@ -55,6 +55,12 @@
         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.
 

Modified: trunk/qgis/python/plugins/osm/OsmPlugin.py
===================================================================
--- trunk/qgis/python/plugins/osm/OsmPlugin.py	2010-11-11 15:33:29 UTC (rev 14544)
+++ trunk/qgis/python/plugins/osm/OsmPlugin.py	2010-11-11 18:36:08 UTC (rev 14545)
@@ -147,6 +147,7 @@
         """Function unloads the OSM Plugin.
         """
 
+        self.dbm.disconnectSignals()
         self.canvas.unsetMapTool(self.dockWidget.mapTool)
         del self.dockWidget.mapTool
         self.dockWidget.mapTool=None



More information about the QGIS-commit mailing list