Skip to content
Permalink
Browse files

ask for postgres credentials on any connection error (not only missin…

…g password)

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

0 comments on commit b859ba9

Please sign in to comment.
You can’t perform that action at this time.