Skip to content

Commit

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

git-svn-id: http://svn.osgeo.org/qgis/trunk@14380 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Oct 14, 2010
1 parent 6740566 commit 4f4a212
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
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
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
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 4f4a212

Please sign in to comment.