File tree Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -81,22 +81,20 @@ bool QgsDb2ConnectionItem::ConnInfoFromParameters(
81
81
+ " dbname='" + database + " ' " ;
82
82
}
83
83
84
+ if ( !username.isEmpty () )
85
+ {
86
+ connInfo += " user='" + username + " ' " ;
87
+ }
88
+
84
89
if ( !authcfg.isEmpty () )
85
90
{
86
91
connInfo += " authcfg='" + authcfg + " ' " ;
87
92
}
88
- else // include user and password if authcfg is empty
93
+ else if ( ! password. isEmpty () )
89
94
{
90
- if ( !username.isEmpty () )
91
- {
92
- connInfo += " user='" + username + " ' " ;
93
- }
94
-
95
- if ( !password.isEmpty () )
96
- {
97
- connInfo += " password='" + password + " ' " ;
98
- }
95
+ connInfo += " password='" + password + " ' " ;
99
96
}
97
+
100
98
QgsDebugMsg ( " connInfo: '" + connInfo + " '" );
101
99
return true ;
102
100
}
Original file line number Diff line number Diff line change @@ -1728,7 +1728,6 @@ QgsDataSourceURI QgsPostgresConn::connUri( const QString& theConnName )
1728
1728
1729
1729
if ( !authcfg.isEmpty () )
1730
1730
{
1731
- username.clear ();
1732
1731
password.clear ();
1733
1732
}
1734
1733
You can’t perform that action at this time.
0 commit comments