[postgres][db2] username and authcfg are not mutually exclusive (followup aae7a325)

This commit is contained in:
Juergen E. Fischer 2018-07-04 19:21:38 +02:00
parent 761cdaf30a
commit fba9982beb
2 changed files with 10 additions and 16 deletions

View File

@ -84,18 +84,18 @@ bool QgsDb2ConnectionItem::ConnInfoFromParameters(
{
connInfo += "authcfg='" + authcfg + "' ";
}
else // include user and password if authcfg is empty
{
if ( !username.isEmpty() )
{
connInfo += "user='" + username + "' ";
}
if ( !password.isEmpty() )
{
connInfo += "password='" + password + "' ";
}
if ( !password.isEmpty() )
{
// include password if authcfg is empty
connInfo += "password='" + password + "' ";
}
if ( !username.isEmpty() )
{
connInfo += "user='" + username + "' ";
}
QgsDebugMsg( "connInfo: '" + connInfo + "'" );
return true;
}

View File

@ -1788,12 +1788,6 @@ QgsDataSourceUri QgsPostgresConn::connUri( const QString &connName )
QString authcfg = settings.value( key + "/authcfg" ).toString();
if ( !authcfg.isEmpty() )
{
username.clear();
password.clear();
}
QgsDataSourceUri uri;
if ( !service.isEmpty() )
{