Skip to content
Permalink
Browse files

follow up renaming enum keys

  • Loading branch information
3nids committed Sep 15, 2020
1 parent 1660d72 commit fb7f7ba6971a39f5095aebd1d043400379e5d855
@@ -293,7 +293,7 @@ Formats string for display

static QString readableConfigurationFlag( ConfigurationFlag flag );
%Docstring
Returns a readable and translated value of the configuration flag
Returns the reabable and translated value of the configuration flag

.. versionadded:: 3.16
%End
@@ -354,9 +354,9 @@ QString QgsField::readableConfigurationFlag( QgsField::ConfigurationFlag flag )
return QObject::tr( "None" );
case ConfigurationFlag::Searchable:
return QObject::tr( "Searchable" );
case ConfigurationFlag::Wms:
case ConfigurationFlag::ExposeViaWms:
return QStringLiteral( "Expose via WMS" );
case ConfigurationFlag::Wfs:
case ConfigurationFlag::ExposeViaWfs:
return QStringLiteral( "Expose via WFS" );
case ConfigurationFlag::DefaultFlags:
return QObject::tr( "Default flags" );
@@ -83,7 +83,7 @@ class CORE_EXPORT QgsField
Searchable = 1 << 1, //!< Defines if the field is searchable (used in the locator search for instance)
ExposeViaWms = 1 << 2, //!< Fields is available if layer is served as WMS from QGIS server
ExposeViaWfs = 1 << 3, //!< Fields is available if layer is served as WFS from QGIS server
DefaultFlags = Searchable | Wms | Wfs, //!< Default set of flags for a field
DefaultFlags = Searchable | ExposeViaWms | ExposeViaWfs, //!< Default set of flags for a field
};
Q_ENUM( ConfigurationFlag )
Q_DECLARE_FLAGS( ConfigurationFlags, ConfigurationFlag )
@@ -456,7 +456,7 @@ json QgsLandingPageUtils::projectInfo( const QString &projectUri )
const QgsFields &cFields { vl->fields() };
for ( const QgsField &field : cFields )
{
if ( !field.configurationFlags().testFlag( QgsField::ConfigurationFlag::Wfs ) )
if ( !field.configurationFlags().testFlag( QgsField::ConfigurationFlag::ExposeViaWfs ) )
{
++fieldIdx;
continue;
@@ -267,7 +267,7 @@ namespace QgsWfs
const QgsField field = fields.at( idx );
QString attributeName = field.name();
//skip attribute if excluded from WFS publication
if ( !field.configurationFlags().testFlag( QgsField::ConfigurationFlag::Wfs ) )
if ( !field.configurationFlags().testFlag( QgsField::ConfigurationFlag::ExposeViaWfs ) )
{
continue;
}
@@ -249,7 +249,7 @@ namespace QgsWfs

//Using pending attributes and pending fields
QgsAttributeList attrIndexes = vlayer->attributeList();
QgsFields fields = vlayer->fields();
const QgsFields fields = vlayer->fields();
bool withGeom = true;
if ( !propertyList.isEmpty() && propertyList.first() != QStringLiteral( "*" ) )
{
@@ -261,6 +261,9 @@ namespace QgsWfs
QList<QString> fieldnames;
for ( int idx = 0; idx < fields.count(); ++idx )
{
if (!fields.at(idx).configurationFlags().testFlag(QgsField::ConfigurationFlag::ExposeViaWfs))
continue;

fieldnames.append( fields[idx].name() );
propertynames.append( fields.field( idx ).name().replace( ' ', '_' ).replace( cleanTagNameRegExp, QString() ) );
}
@@ -288,21 +291,6 @@ namespace QgsWfs
}
}

//excluded attributes for this layer
const QSet<QString> &layerExcludedAttributes = vlayer->excludeAttributesWfs();
if ( !attrIndexes.isEmpty() && !layerExcludedAttributes.isEmpty() )
{
foreach ( const QString &excludedAttribute, layerExcludedAttributes )
{
int fieldNameIdx = fields.indexOf( excludedAttribute );
if ( fieldNameIdx > -1 && attrIndexes.contains( fieldNameIdx ) )
{
attrIndexes.removeOne( fieldNameIdx );
}
}
}


// update request
QgsFeatureRequest featureRequest = query.featureRequest;

@@ -245,7 +245,7 @@ QgsFields QgsWfs3AbstractItemsHandler::publishedFields( const QgsVectorLayer *vL
const QgsFields &fields = vLayer->fields();
for ( const QgsField &field : fields )
{
if ( field.configurationFlags().testFlag( QgsField::ConfigurationFlag::Wfs ) )
if ( field.configurationFlags().testFlag( QgsField::ConfigurationFlag::ExposeViaWfs ) )
{
publishedAttributes.push_back( field.name() );
}
@@ -1878,7 +1878,7 @@ namespace QgsWms
for ( int idx = 0; idx < layerFields.count(); ++idx )
{
QgsField field = layerFields.at( idx );
if ( !field.configurationFlags().testFlag( QgsField::ConfigurationFlag::Wms ) )
if ( !field.configurationFlags().testFlag( QgsField::ConfigurationFlag::ExposeViaWms ) )
{
continue;
}
@@ -1567,7 +1567,7 @@ namespace QgsWms
for ( int i = 0; i < featureAttributes.count(); ++i )
{
//skip attribute if it is explicitly excluded from WMS publication
if ( fields.at( i ).configurationFlags().testFlag( QgsField::ConfigurationFlag::Wms ) )
if ( fields.at( i ).configurationFlags().testFlag( QgsField::ConfigurationFlag::ExposeViaWms ) )
{
continue;
}
@@ -2416,7 +2416,7 @@ namespace QgsWms
{
QString attributeName = fields.at( i ).name();
//skip attribute if it is explicitly excluded from WMS publication
if ( !fields.at( i ).configurationFlags().testFlag( QgsField::ConfigurationFlag::Wms ) )
if ( !fields.at( i ).configurationFlags().testFlag( QgsField::ConfigurationFlag::ExposeViaWms ) )
{
continue;
}

0 comments on commit fb7f7ba

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