mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
db manager: don't consider added layer w/o a dataProvider
(cherry picked from commit 28aa9ebdb75eb099b83a3596b3f3c5c6e5c6f591)
This commit is contained in:
parent
46ea229049
commit
a9464d7c94
@ -78,7 +78,7 @@ class DBManagerPlugin:
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user