Skip to content

Commit

Permalink
[afs] Remove 'cached' checkbox from source select dialog
Browse files Browse the repository at this point in the history
This checkbox was never hooked up to anything (caching is ALWAYS
enabled for the provider).
  • Loading branch information
nyalldawson committed Nov 8, 2018
1 parent 85bc01f commit 1066161
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
7 changes: 2 additions & 5 deletions src/providers/arcgisrest/qgsafssourceselect.cpp
Expand Up @@ -110,14 +110,11 @@ bool QgsAfsSourceSelect::connectToService( const QgsOwsConnection &connection )
QStandardItem *nameItem = new QStandardItem( name );
QStandardItem *abstractItem = new QStandardItem( description );
abstractItem->setToolTip( description );
QStandardItem *cachedItem = new QStandardItem();
QStandardItem *filterItem = new QStandardItem();
cachedItem->setCheckable( true );
cachedItem->setCheckState( Qt::Checked );

mAvailableCRS[name] = QList<QString>() << authid;

layerItems.insert( layerId, QList<QStandardItem *>() << idItem << nameItem << abstractItem << cachedItem << filterItem );
layerItems.insert( layerId, QList<QStandardItem *>() << idItem << nameItem << abstractItem << filterItem );
}
}, serviceInfoMap, baseItemUrl );

Expand Down Expand Up @@ -158,7 +155,7 @@ void QgsAfsSourceSelect::buildQuery( const QgsOwsConnection &connection, const Q
{
return;
}
QModelIndex filterIndex = index.sibling( index.row(), 4 );
QModelIndex filterIndex = index.sibling( index.row(), 3 );
const QString url = index.sibling( index.row(), 0 ).data( UrlRole ).toString();

// Query available fields
Expand Down
8 changes: 3 additions & 5 deletions src/providers/arcgisrest/qgsarcgisservicesourceselect.cpp
Expand Up @@ -78,8 +78,7 @@ QgsArcGisServiceSourceSelect::QgsArcGisServiceSourceSelect( const QString &servi
mModel->setHorizontalHeaderItem( 2, new QStandardItem( QStringLiteral( "Abstract" ) ) );
if ( serviceType == FeatureService )
{
mModel->setHorizontalHeaderItem( 3, new QStandardItem( QStringLiteral( "Cache Feature" ) ) );
mModel->setHorizontalHeaderItem( 4, new QStandardItem( QStringLiteral( "Filter" ) ) );
mModel->setHorizontalHeaderItem( 3, new QStandardItem( QStringLiteral( "Filter" ) ) );
gbImageEncoding->hide();
}
else
Expand Down Expand Up @@ -346,14 +345,13 @@ void QgsArcGisServiceSourceSelect::addButtonClicked()
QString layerTitle = mModel->itemFromIndex( mModel->index( row, 0, idx.parent() ) )->text(); //layer title/id
QString layerName = mModel->itemFromIndex( mModel->index( row, 1, idx.parent() ) )->text(); //layer name
const QString layerUri = mModel->itemFromIndex( mModel->index( row, 0, idx.parent() ) )->data( UrlRole ).toString();
bool cacheFeatures = mServiceType == FeatureService ? mModel->itemFromIndex( mModel->index( row, 3, idx.parent() ) )->checkState() == Qt::Checked : false;
QString filter = mServiceType == FeatureService ? mModel->itemFromIndex( mModel->index( row, 4, idx.parent() ) )->text() : QString(); //optional filter specified by user
QString filter = mServiceType == FeatureService ? mModel->itemFromIndex( mModel->index( row, 3, idx.parent() ) )->text() : QString(); //optional filter specified by user
if ( cbxUseTitleLayerName->isChecked() && !layerTitle.isEmpty() )
{
layerName = layerTitle;
}
QgsRectangle layerExtent;
if ( mServiceType == FeatureService && ( cbxFeatureCurrentViewExtent->isChecked() || !cacheFeatures ) )
if ( mServiceType == FeatureService && ( cbxFeatureCurrentViewExtent->isChecked() ) )
{
layerExtent = extent;
}
Expand Down

0 comments on commit 1066161

Please sign in to comment.