Skip to content
Permalink
Browse files

Remove non-functional querying code from feature server source select

  • Loading branch information
nyalldawson committed Dec 23, 2020
1 parent 1192056 commit c196a94bc79564ff51a829a4397bbf597ceda63a

This file was deleted.

This file was deleted.

@@ -15,7 +15,6 @@

#include "qgsarcgisrestdataitemguiprovider.h"
#include "qgsarcgisrestdataitems.h"
#include "qgsafssourceselect.h"
#include "qgsmanageconnectionsdialog.h"
#include "qgsnewarcgisrestconnection.h"
#include "qgsowsconnection.h"
@@ -86,10 +86,6 @@ QgsArcGisRestSourceSelect::QgsArcGisRestSourceSelect( QWidget *parent, Qt::Windo
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsArcGisRestSourceSelect::showHelp );
setWindowTitle( QStringLiteral( "Add ArcGIS REST Layer" ) );

mBuildQueryButton = buttonBox->addButton( tr( "&Build query" ), QDialogButtonBox::ActionRole );
mBuildQueryButton->setDisabled( true );
connect( mBuildQueryButton, &QAbstractButton::clicked, this, &QgsArcGisRestSourceSelect::buildQueryButtonClicked );

connect( buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject );
connect( btnNew, &QAbstractButton::clicked, this, &QgsArcGisRestSourceSelect::addEntryToServerList );
connect( btnEdit, &QAbstractButton::clicked, this, &QgsArcGisRestSourceSelect::modifyEntryOfServerList );
@@ -179,7 +175,6 @@ void QgsArcGisRestSourceSelect::showEvent( QShowEvent * )
// provide a horizontal scroll bar instead of using ellipse (...) for longer items
mBrowserView->setTextElideMode( Qt::ElideNone );

connect( mBrowserView, &QAbstractItemView::doubleClicked, this, &QgsArcGisRestSourceSelect::treeWidgetItemDoubleClicked );
connect( mBrowserView->selectionModel(), &QItemSelectionModel::currentRowChanged, this, &QgsArcGisRestSourceSelect::treeWidgetCurrentRowChanged );

mBrowserView->expand( mProxyModel->index( 0, 0 ) );
@@ -286,7 +281,6 @@ void QgsArcGisRestSourceSelect::connectToServer()

btnConnect->setEnabled( true );
emit enableButtons( haveLayers );
mBuildQueryButton->setEnabled( haveLayers );
updateCrsLabel();
}

@@ -348,7 +342,6 @@ void QgsArcGisRestSourceSelect::addButtonClicked()
{
const QString layerName = layerItem->name();

QString filter;// = mServiceType == FeatureService ? mModel->itemFromIndex( mModel->index( row, 3, idx.parent() ) )->text() : QString(); //optional filter specified by user
QgsRectangle layerExtent;
if ( cbxFeatureCurrentViewExtent->isChecked() )
{
@@ -359,7 +352,6 @@ void QgsArcGisRestSourceSelect::addButtonClicked()
uri.setParam( QStringLiteral( "crs" ), pCrsString );
if ( qobject_cast< QgsArcGisFeatureServiceLayerItem *>( layerItem ) )
{
uri.setParam( QStringLiteral( "filter" ), filter );
if ( !layerExtent.isEmpty() )
{
uri.setParam( QStringLiteral( "bbox" ), QStringLiteral( "%1,%2,%3,%4" ).arg( layerExtent.xMinimum() ).arg( layerExtent.yMinimum() ).arg( layerExtent.xMaximum() ).arg( layerExtent.yMaximum() ) );
@@ -427,34 +419,16 @@ void QgsArcGisRestSourceSelect::cmbConnections_activated( int index )
QgsOwsConnection::setSelectedConnection( QStringLiteral( "ARCGISFEATURESERVER" ), cmbConnections->currentText() );
}

void QgsArcGisRestSourceSelect::treeWidgetItemDoubleClicked( const QModelIndex &index )
{
QgsDebugMsg( QStringLiteral( "double-click called" ) );
QgsOwsConnection connection( QStringLiteral( "ARCGISFEATURESERVER" ), cmbConnections->currentText() );
buildQuery( connection, index );
}

void QgsArcGisRestSourceSelect::treeWidgetCurrentRowChanged( const QModelIndex &current, const QModelIndex &previous )
{
Q_UNUSED( previous )
QgsDebugMsg( QStringLiteral( "treeWidget_currentRowChanged called" ) );
updateCrsLabel();
updateImageEncodings();

if ( true ) // mServiceType == FeatureService )
{
mBuildQueryButton->setEnabled( current.isValid() );
}
emit enableButtons( current.isValid() );
}

void QgsArcGisRestSourceSelect::buildQueryButtonClicked()
{
QgsDebugMsg( QStringLiteral( "mBuildQueryButton click called" ) );
QgsOwsConnection connection( QStringLiteral( "ARCGISFEATURESERVER" ), cmbConnections->currentText() );
buildQuery( connection, mBrowserView->selectionModel()->currentIndex() );
}

void QgsArcGisRestSourceSelect::filterChanged( const QString &text )
{
mProxyModel->setFilterString( text );
@@ -71,13 +71,8 @@ class QgsArcGisRestSourceSelect : public QgsAbstractDataSourceWidget, protected
QgsBrowserGuiModel *mBrowserModel = nullptr;
QgsArcGisRestBrowserProxyModel *mProxyModel = nullptr;

QPushButton *mBuildQueryButton = nullptr;
QButtonGroup *mImageEncodingGroup = nullptr;

//! May be implemented in child classes for services which support customized queries.
virtual void buildQuery( const QgsOwsConnection &, const QModelIndex & ) {}
//! To be implemented in the child class. Constructs an URI for the specified service layer.

//! Updates the UI for the list of available image encodings from the specified list.
void populateImageEncodings( const QString &supportedFormats );
//! Returns the selected image encoding.
@@ -97,15 +92,13 @@ class QgsArcGisRestSourceSelect : public QgsAbstractDataSourceWidget, protected
void deleteEntryOfServerList();
void modifyEntryOfServerList();
void addButtonClicked() override;
void buildQueryButtonClicked();
void updateCrsLabel();
void updateImageEncodings();
void connectToServer();
void disconnectFromServer();
void filterChanged( const QString &text );
void cmbConnections_activated( int index );
void showHelp();
void treeWidgetItemDoubleClicked( const QModelIndex &index );
void treeWidgetCurrentRowChanged( const QModelIndex &current, const QModelIndex &previous );
void btnSave_clicked();
void btnLoad_clicked();

0 comments on commit c196a94

Please sign in to comment.
You can’t perform that action at this time.