File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ extern "C"
31
31
}
32
32
33
33
QgsNewConnection::QgsNewConnection ( QWidget *parent, const QString& connName, Qt::WFlags fl )
34
- : QDialog( parent, fl )
34
+ : QDialog( parent, fl ), mOriginalConnName( connName )
35
35
{
36
36
setupUi ( this );
37
37
@@ -141,6 +141,11 @@ void QgsNewConnection::saveConnection()
141
141
QSettings settings;
142
142
QString baseKey = " /PostgreSQL/connections/" ;
143
143
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
+ }
144
149
baseKey += txtName->text ();
145
150
settings.setValue ( baseKey + " /host" , txtHost->text () );
146
151
settings.setValue ( baseKey + " /database" , txtDatabase->text () );
You can’t perform that action at this time.
0 commit comments