Skip to content

Commit

Permalink
ask for postgres credentials on any connection error (not only missin…
Browse files Browse the repository at this point in the history
…g password)

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14380 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Oct 14, 2010
1 parent 53349fa commit b859ba9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/postgres/qgspgnewconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void QgsPgNewConnection::testConnection()

PGconn *pd = PQconnectdb( conninfo.toLocal8Bit() ); // use what is set based on locale; after connecting, use Utf8
// check the connection status
if ( PQstatus( pd ) != CONNECTION_OK && QString::fromUtf8( PQerrorMessage( pd ) ) == PQnoPasswordSupplied )
if ( PQstatus( pd ) != CONNECTION_OK )
{
QString username = txtUsername->text();
QString password = txtPassword->text();
Expand Down
2 changes: 1 addition & 1 deletion src/app/postgres/qgspgsourceselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ void QgsPgSourceSelect::on_btnConnect_clicked()

pd = PQconnectdb( m_privConnInfo.toLocal8Bit() ); // use what is set based on locale; after connecting, use Utf8
// check the connection status
if ( PQstatus( pd ) != CONNECTION_OK && QString::fromUtf8( PQerrorMessage( pd ) ) == PQnoPasswordSupplied )
if ( PQstatus( pd ) != CONNECTION_OK )
{
while ( PQstatus( pd ) != CONNECTION_OK )
{
Expand Down
2 changes: 1 addition & 1 deletion src/providers/postgres/qgspostgresprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ QgsPostgresProvider::Conn *QgsPostgresProvider::Conn::connectDb( const QString &

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

0 comments on commit b859ba9

Please sign in to comment.