File tree Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -80,22 +80,21 @@ bool QgsDb2ConnectionItem::ConnInfoFromParameters(
80
80
+ " dbname='" + database + " ' " ;
81
81
}
82
82
83
+ if ( !username.isEmpty () )
84
+ {
85
+ connInfo += " user='" + username + " ' " ;
86
+ }
87
+
83
88
if ( !authcfg.isEmpty () )
84
89
{
85
90
connInfo += " authcfg='" + authcfg + " ' " ;
86
91
}
87
- else // include user and password if authcfg is empty
92
+ else if ( ! password. isEmpty () )
88
93
{
89
- if ( !username.isEmpty () )
90
- {
91
- connInfo += " user='" + username + " ' " ;
92
- }
93
-
94
- if ( !password.isEmpty () )
95
- {
96
- connInfo += " password='" + password + " ' " ;
97
- }
94
+ // include user and password if authcfg is empty
95
+ connInfo += " password='" + password + " ' " ;
98
96
}
97
+
99
98
QgsDebugMsg ( " connInfo: '" + connInfo + " '" );
100
99
return true ;
101
100
}
Original file line number Diff line number Diff line change @@ -1790,7 +1790,6 @@ QgsDataSourceUri QgsPostgresConn::connUri( const QString &connName )
1790
1790
1791
1791
if ( !authcfg.isEmpty () )
1792
1792
{
1793
- username.clear ();
1794
1793
password.clear ();
1795
1794
}
1796
1795
You can’t perform that action at this time.
0 commit comments