Skip to content
Permalink
Browse files

db manager: don't consider added layer w/o a dataProvider

(cherry picked from commit 28aa9ebdb75eb099b83a3596b3f3c5c6e5c6f591)
  • Loading branch information
jef-n committed Aug 30, 2016
1 parent 46ea229 commit a9464d7c9467374e338bf30c21af71164aa85eb8
Showing with 1 addition and 1 deletion.
  1. +1 −1 python/plugins/db_manager/db_manager_plugin.py
@@ -78,7 +78,7 @@ def unload(self):
self.dlg.close()

def onLayerWasAdded(self, aMapLayer):
if aMapLayer.dataProvider().name() in ['postgres', 'spatialite', 'oracle']:
if hasattr(aMapLayer, 'dataProvider') and aMapLayer.dataProvider().name() in ['postgres', 'spatialite', 'oracle']:
uri = QgsDataSourceUri(aMapLayer.source())
if re.search('^\(SELECT .+ FROM .+\)$', uri.table(), re.S):
self.iface.legendInterface().addLegendLayerActionForLayer(self.layerAction, aMapLayer)

0 comments on commit a9464d7

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