Skip to content
Permalink
Browse files

[BUGFIX][DB Manager] Fix update SQL Layer datasource

  • Loading branch information
rldhont committed Oct 6, 2017
1 parent 5dce8ed commit e45206ab3e023fcfce4eb9224542b4ff2e49467e
Showing with 3 additions and 3 deletions.
  1. +3 −3 python/plugins/db_manager/dlg_sql_layer_window.py
@@ -31,7 +31,7 @@
from qgis.PyQt.Qsci import QsciAPIs
from qgis.PyQt.QtXml import QDomDocument

from qgis.core import QgsProject, QgsDataSourceUri
from qgis.core import QgsProject, QgsDataSourceUri, QgsReadWriteContext
from qgis.utils import OverrideCursor

from .db_plugins import createDbPlugin
@@ -328,11 +328,11 @@ def updateSqlLayer(self):
XMLDocument = QDomDocument("style")
XMLMapLayers = XMLDocument.createElement("maplayers")
XMLMapLayer = XMLDocument.createElement("maplayer")
self.layer.writeLayerXML(XMLMapLayer, XMLDocument)
self.layer.writeLayerXml(XMLMapLayer, XMLDocument, QgsReadWriteContext())
XMLMapLayer.firstChildElement("datasource").firstChild().setNodeValue(layer.source())
XMLMapLayers.appendChild(XMLMapLayer)
XMLDocument.appendChild(XMLMapLayers)
self.layer.readLayerXML(XMLMapLayer)
self.layer.readLayerXml(XMLMapLayer, QgsReadWriteContext())
self.layer.reload()
self.iface.actionDraw().trigger()
self.iface.mapCanvas().refresh()

0 comments on commit e45206a

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