Skip to content
Permalink
Browse files

explicitly call QgsDataSourceURI.connectionInfo() with appropriate pa…

…rameter
  • Loading branch information
SebDieBln authored and luipir committed Nov 17, 2015
1 parent 93ab890 commit ef91882fe0fc8cce2c61bd32db9877a52ebd30cc
@@ -125,7 +125,7 @@ def __init__(self, uri, connName):
self._checkGeometryColumnsTable()

def _connectionInfo(self):
return unicode(self._uri.connectionInfo())
return unicode(self._uri.connectionInfo(True))

def _checkSpatial(self):
"""Check whether Oracle Spatial is present in catalog."""
@@ -129,7 +129,7 @@ def connect(self, parent=None):
max_attempts = 3
for i in range(max_attempts):
(ok, username, password) = QgsCredentials.instance().get(
uri.connectionInfo(), username, password, err)
uri.connectionInfo(False), username, password, err)

if not ok:
return False
@@ -145,7 +145,7 @@ def connect(self, parent=None):
continue

QgsCredentials.instance().put(
uri.connectionInfo(), username, password)
uri.connectionInfo(False), username, password)

return True

@@ -56,7 +56,7 @@ def __init__(self, uri):
except self.connection_error_types() as e:
err = unicode(e)
uri = self.uri()
conninfo = uri.connectionInfo()
conninfo = uri.connectionInfo(False)

for i in range(3):
(ok, username, password) = QgsCredentials.instance().get(conninfo, username, password, err)
@@ -70,7 +70,7 @@ def __init__(self, uri):
uri.setPassword(password)

try:
self.connection = psycopg2.connect(uri.connectionInfo().encode('utf-8'))
self.connection = psycopg2.connect(uri.connectionInfo(True).encode('utf-8'))
QgsCredentials.instance().put(conninfo, username, password)
except self.connection_error_types() as e:
if i == 2:
@@ -90,7 +90,7 @@ def __init__(self, uri):
self._checkRasterColumnsTable()

def _connectionInfo(self):
return unicode(self.uri().connectionInfo())
return unicode(self.uri().connectionInfo(True))

def _checkSpatial(self):
""" check whether postgis_version is present in catalog """
@@ -292,7 +292,7 @@ def toMapLayer(self):
if not rl.isValid():
err = rl.error().summary()
uri = QgsDataSourceURI(self.database().uri())
conninfo = uri.connectionInfo()
conninfo = uri.connectionInfo(False)
username = uri.username()
password = uri.password()

0 comments on commit ef91882

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