Index: src/app/qgsnewconnection.cpp =================================================================== --- src/app/qgsnewconnection.cpp (revision 12347) +++ src/app/qgsnewconnection.cpp (working copy) @@ -126,6 +126,23 @@ void QgsNewConnection::saveConnection() { QSettings settings; + + // check for existing connection with same name + settings.beginGroup( "/PostgreSQL/connections" ); + QStringList keys = settings.childGroups(); + if ( keys.contains( txtName->text() ) ) + { + int res = QMessageBox::question( this, + tr( "Save connection" ), + tr( "Conection with name %1 already exists. Overwrite?" ).arg( txtName->text() ), + QMessageBox::Yes | QMessageBox::No ); + if ( res != QMessageBox::Yes ) + { + return; + } + } + settings.endGroup(); + QString baseKey = "/PostgreSQL/connections/"; settings.setValue( baseKey + "selected", txtName->text() ); //delete original entry first