Skip to content

Commit b180864

Browse files
author
mhugent
committed
fix for bug #1756
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11041 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent ad3849a commit b180864

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/app/qgsnewconnection.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ extern "C"
3131
}
3232

3333
QgsNewConnection::QgsNewConnection( QWidget *parent, const QString& connName, Qt::WFlags fl )
34-
: QDialog( parent, fl )
34+
: QDialog( parent, fl ), mOriginalConnName( connName )
3535
{
3636
setupUi( this );
3737

@@ -141,6 +141,11 @@ void QgsNewConnection::saveConnection()
141141
QSettings settings;
142142
QString baseKey = "/PostgreSQL/connections/";
143143
settings.setValue( baseKey + "selected", txtName->text() );
144+
//delete original entry first
145+
if ( !mOriginalConnName.isNull() && mOriginalConnName != txtName->text() )
146+
{
147+
settings.remove( baseKey + mOriginalConnName );
148+
}
144149
baseKey += txtName->text();
145150
settings.setValue( baseKey + "/host", txtHost->text() );
146151
settings.setValue( baseKey + "/database", txtDatabase->text() );

0 commit comments

Comments
 (0)