@@ -192,8 +192,6 @@ QgsPgSourceSelect::QgsPgSourceSelect( QWidget *parent, Qt::WFlags fl, bool manag
192192 mSearchModeComboBox ->setVisible ( false );
193193 mSearchModeLabel ->setVisible ( false );
194194 mSearchTableEdit ->setVisible ( false );
195-
196- cbxAllowGeometrylessTables->setDisabled ( true );
197195}
198196/* * Autoconnected SLOTS **/
199197// Slot for adding a new connection
@@ -215,33 +213,12 @@ void QgsPgSourceSelect::on_btnDelete_clicked()
215213 if ( QMessageBox::Ok != QMessageBox::information ( this , tr ( " Confirm Delete" ), msg, QMessageBox::Ok | QMessageBox::Cancel ) )
216214 return ;
217215
218- QgsPgSourceSelect ::deleteConnection ( cmbConnections->currentText () );
216+ QgsPostgresConn ::deleteConnection ( cmbConnections->currentText () );
219217
220218 populateConnectionList ();
221219 emit connectionsChanged ();
222220}
223221
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-
245222void QgsPgSourceSelect::on_btnSave_clicked ()
246223{
247224 QgsManageConnectionsDialog dlg ( this , QgsManageConnectionsDialog::Export, QgsManageConnectionsDialog::PostGIS );
@@ -277,14 +254,13 @@ void QgsPgSourceSelect::on_btnEdit_clicked()
277254/* * End Autoconnected SLOTS **/
278255
279256// Remember which database is selected
280- void QgsPgSourceSelect::on_cmbConnections_activated ( int )
257+ void QgsPgSourceSelect::on_cmbConnections_currentIndexChanged ( const QString & text )
281258{
282259 // Remember which database was selected.
283- QgsPostgresConn::setSelectedConnection ( cmbConnections-> currentText () );
260+ QgsPostgresConn::setSelectedConnection ( text );
284261
285262 cbxAllowGeometrylessTables->blockSignals ( true );
286- QSettings settings;
287- cbxAllowGeometrylessTables->setChecked ( settings.value ( " /PostgreSQL/connections/" + cmbConnections->currentText () + " /allowGeometrylessTables" , false ).toBool () );
263+ cbxAllowGeometrylessTables->setChecked ( QgsPostgresConn::allowGeometrylessTables ( text ) );
288264 cbxAllowGeometrylessTables->blockSignals ( false );
289265}
290266
@@ -466,11 +442,8 @@ void QgsPgSourceSelect::on_btnConnect_clicked()
466442 {
467443 QApplication::setOverrideCursor ( Qt::WaitCursor );
468444
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 () );
474447 bool allowGeometrylessTables = cbxAllowGeometrylessTables->isChecked ();
475448
476449 QVector<QgsPostgresLayerProperty> layers;
0 commit comments