Skip to content

Commit 4f4a212

Browse files
author
jef
committed
ask for postgres credentials on any connection error (not only missing password)
git-svn-id: http://svn.osgeo.org/qgis/trunk@14380 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 6740566 commit 4f4a212

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/app/postgres/qgspgnewconnection.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ void QgsPgNewConnection::testConnection()
168168

169169
PGconn *pd = PQconnectdb( conninfo.toLocal8Bit() ); // use what is set based on locale; after connecting, use Utf8
170170
// check the connection status
171-
if ( PQstatus( pd ) != CONNECTION_OK && QString::fromUtf8( PQerrorMessage( pd ) ) == PQnoPasswordSupplied )
171+
if ( PQstatus( pd ) != CONNECTION_OK )
172172
{
173173
QString username = txtUsername->text();
174174
QString password = txtPassword->text();

src/app/postgres/qgspgsourceselect.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ void QgsPgSourceSelect::on_btnConnect_clicked()
445445

446446
pd = PQconnectdb( m_privConnInfo.toLocal8Bit() ); // use what is set based on locale; after connecting, use Utf8
447447
// check the connection status
448-
if ( PQstatus( pd ) != CONNECTION_OK && QString::fromUtf8( PQerrorMessage( pd ) ) == PQnoPasswordSupplied )
448+
if ( PQstatus( pd ) != CONNECTION_OK )
449449
{
450450
while ( PQstatus( pd ) != CONNECTION_OK )
451451
{

src/providers/postgres/qgspostgresprovider.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ QgsPostgresProvider::Conn *QgsPostgresProvider::Conn::connectDb( const QString &
215215

216216
PGconn *pd = PQconnectdb( conninfo.toLocal8Bit() ); // use what is set based on locale; after connecting, use Utf8
217217
// check the connection status
218-
if ( PQstatus( pd ) != CONNECTION_OK && QString::fromUtf8( PQerrorMessage( pd ) ) == PQnoPasswordSupplied )
218+
if ( PQstatus( pd ) != CONNECTION_OK )
219219
{
220220
QgsDataSourceURI uri( conninfo );
221221
QString username = uri.username();

0 commit comments

Comments
 (0)