@@ -192,8 +192,6 @@ QgsPgSourceSelect::QgsPgSourceSelect( QWidget *parent, Qt::WFlags fl, bool manag
192
192
mSearchModeComboBox ->setVisible ( false );
193
193
mSearchModeLabel ->setVisible ( false );
194
194
mSearchTableEdit ->setVisible ( false );
195
-
196
- cbxAllowGeometrylessTables->setDisabled ( true );
197
195
}
198
196
/* * Autoconnected SLOTS **/
199
197
// Slot for adding a new connection
@@ -215,33 +213,12 @@ void QgsPgSourceSelect::on_btnDelete_clicked()
215
213
if ( QMessageBox::Ok != QMessageBox::information ( this , tr ( " Confirm Delete" ), msg, QMessageBox::Ok | QMessageBox::Cancel ) )
216
214
return ;
217
215
218
- QgsPgSourceSelect ::deleteConnection ( cmbConnections->currentText () );
216
+ QgsPostgresConn ::deleteConnection ( cmbConnections->currentText () );
219
217
220
218
populateConnectionList ();
221
219
emit connectionsChanged ();
222
220
}
223
221
224
- void QgsPgSourceSelect::deleteConnection ( QString name )
225
- {
226
- QString key = " /Postgresql/connections/" + name;
227
- QSettings settings;
228
- settings.remove ( key + " /service" );
229
- settings.remove ( key + " /host" );
230
- settings.remove ( key + " /port" );
231
- settings.remove ( key + " /database" );
232
- settings.remove ( key + " /username" );
233
- settings.remove ( key + " /password" );
234
- settings.remove ( key + " /sslmode" );
235
- settings.remove ( key + " /publicOnly" );
236
- settings.remove ( key + " /geometryColumnsOnly" );
237
- settings.remove ( key + " /allowGeometrylessTables" );
238
- settings.remove ( key + " /estimatedMetadata" );
239
- settings.remove ( key + " /saveUsername" );
240
- settings.remove ( key + " /savePassword" );
241
- settings.remove ( key + " /save" );
242
- settings.remove ( key );
243
- }
244
-
245
222
void QgsPgSourceSelect::on_btnSave_clicked ()
246
223
{
247
224
QgsManageConnectionsDialog dlg ( this , QgsManageConnectionsDialog::Export, QgsManageConnectionsDialog::PostGIS );
@@ -277,14 +254,13 @@ void QgsPgSourceSelect::on_btnEdit_clicked()
277
254
/* * End Autoconnected SLOTS **/
278
255
279
256
// Remember which database is selected
280
- void QgsPgSourceSelect::on_cmbConnections_activated ( int )
257
+ void QgsPgSourceSelect::on_cmbConnections_currentIndexChanged ( const QString & text )
281
258
{
282
259
// Remember which database was selected.
283
- QgsPostgresConn::setSelectedConnection ( cmbConnections-> currentText () );
260
+ QgsPostgresConn::setSelectedConnection ( text );
284
261
285
262
cbxAllowGeometrylessTables->blockSignals ( true );
286
- QSettings settings;
287
- cbxAllowGeometrylessTables->setChecked ( settings.value ( " /PostgreSQL/connections/" + cmbConnections->currentText () + " /allowGeometrylessTables" , false ).toBool () );
263
+ cbxAllowGeometrylessTables->setChecked ( QgsPostgresConn::allowGeometrylessTables ( text ) );
288
264
cbxAllowGeometrylessTables->blockSignals ( false );
289
265
}
290
266
@@ -466,11 +442,8 @@ void QgsPgSourceSelect::on_btnConnect_clicked()
466
442
{
467
443
QApplication::setOverrideCursor ( Qt::WaitCursor );
468
444
469
- QSettings settings;
470
- QString key = " /PostgreSQL/connections/" + cmbConnections->currentText ();
471
-
472
- bool searchPublicOnly = settings.value ( key + " /publicOnly" ).toBool ();
473
- bool searchGeometryColumnsOnly = settings.value ( key + " /geometryColumnsOnly" ).toBool ();
445
+ bool searchPublicOnly = QgsPostgresConn::publicSchemaOnly ( cmbConnections->currentText () );
446
+ bool searchGeometryColumnsOnly = QgsPostgresConn::geometryColumnsOnly ( cmbConnections->currentText () );
474
447
bool allowGeometrylessTables = cbxAllowGeometrylessTables->isChecked ();
475
448
476
449
QVector<QgsPostgresLayerProperty> layers;
0 commit comments