Showing with 10 additions and 1 deletion.
  1. +9 −0 src/providers/postgres/qgspgnewconnection.cpp
  2. +1 −1 src/providers/postgres/qgspostgresprovider.cpp
9 changes: 9 additions & 0 deletions src/providers/postgres/qgspgnewconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ void QgsPgNewConnection::accept()
QString baseKey = "/PostgreSQL/connections/";
settings.setValue( baseKey + "selected", txtName->text() );

if ( chkStorePassword->isChecked() &&
QMessageBox::question( this,
tr( "Saving passwords" ),
tr( "WARNING: You have opted to save your password. It will be stored in plain text in your project files and in your home directory on Unix-like systems, or in your user profile on Windows. If you do not want this to happen, please press the Cancel button.\n" ),
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
{
return;
}

// warn if entry was renamed to an existing connection
if (( mOriginalConnName.isNull() || mOriginalConnName != txtName->text() ) &&
( settings.contains( baseKey + txtName->text() + "/service" ) ||
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 @@ -559,7 +559,7 @@ void QgsPostgresProvider::select( QgsAttributeList fetchAttributes, QgsRectangle
}
}

if ( mRequestedSrid != mDetectedSrid )
if ( !mRequestedSrid.isEmpty() && mRequestedSrid != mDetectedSrid )
{
whereClause += QString( " AND %1(%2)=%3" )
.arg( mConnectionRO->majorVersion() < 2 ? "srid" : "st_srid" )
Expand Down