Skip to content
Permalink
Browse files

[API] remove QgsVectorDataProvider::enableGeometrylessFeatures(bool)

Geometryless features are not skipped by default anymore.
  • Loading branch information
wonder-sk committed Apr 11, 2013
1 parent efe3c55 commit 94639ee61e2b2ca1a5bf62aedb386fcaa1f289b5
@@ -220,12 +220,6 @@ class QgsVectorDataProvider : QgsDataProvider
*/
virtual QHash<int, QString> palAttributeIndexNames() const;

/**
* Set whether provider should also return features that don't have
* associated geometry. false by default
*/
void enableGeometrylessFeatures( bool fetch );

/**
* check if provider supports type of field
* @note added in 1.2
@@ -127,9 +127,6 @@ void QgsAttributeTypeLoadDialog::createPreview( int fieldIndex, bool full )
return;
}

QgsVectorDataProvider* dataProvider = vLayer->dataProvider();
dataProvider->enableGeometrylessFeatures( true );

QgsAttributeList attributeList = QgsAttributeList();
attributeList.append( idx );
attributeList.append( idx2 );
@@ -158,7 +155,6 @@ void QgsAttributeTypeLoadDialog::createPreview( int fieldIndex, bool full )
previewTableWidget->setItem( row, 1, new QTableWidgetItem( mit.key() ) );
}

dataProvider->enableGeometrylessFeatures( false );
}

QMap<QString, QVariant> &QgsAttributeTypeLoadDialog::valueMap()
@@ -178,9 +174,6 @@ void QgsAttributeTypeLoadDialog::loadDataToValueMap()
return;
}

QgsVectorDataProvider* dataProvider = vLayer->dataProvider();
dataProvider->enableGeometrylessFeatures( true );

QgsAttributeList attributeList = QgsAttributeList();
attributeList.append( idx );
attributeList.append( idx2 );
@@ -196,7 +189,6 @@ void QgsAttributeTypeLoadDialog::loadDataToValueMap()
mValueMap.insert( f.attribute( idx2 ).toString(), val );
}
}
dataProvider->enableGeometrylessFeatures( false );
}


@@ -30,7 +30,6 @@
QgsVectorDataProvider::QgsVectorDataProvider( QString uri )
: QgsDataProvider( uri )
, mCacheMinMaxDirty( true )
, mFetchFeaturesWithoutGeom( true )
, mAttrPalIndexName( QgsAttrPalIndexNameHash() )
{
QSettings settings;
@@ -238,11 +237,6 @@ QgsAttributeList QgsVectorDataProvider::attributeIndexes()
return list;
}

void QgsVectorDataProvider::enableGeometrylessFeatures( bool fetch )
{
mFetchFeaturesWithoutGeom = fetch;
}

const QList< QgsVectorDataProvider::NativeType > &QgsVectorDataProvider::nativeTypes() const
{
return mNativeTypes;
@@ -279,12 +279,6 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider
*/
virtual QgsAttrPalIndexNameHash palAttributeIndexNames() const { return mAttrPalIndexName; }

/**
* Set whether provider should also return features that don't have
* associated geometry. false by default
*/
void enableGeometrylessFeatures( bool fetch );

/**
* check if provider supports type of field
* @note added in 1.2
@@ -101,14 +101,6 @@ bool QgsOgrFeatureIterator::nextFeature( QgsFeature& feature )
return false;
}

// skip features without geometry
if ( !OGR_F_GetGeometryRef( fet ) && !P->mFetchFeaturesWithoutGeom )
{
OGR_F_Destroy( fet );
close();
return false;
}

readFeature( fet, feature );

feature.setValid( true );
@@ -120,13 +112,6 @@ bool QgsOgrFeatureIterator::nextFeature( QgsFeature& feature )

while (( fet = OGR_L_GetNextFeature( P->ogrLayer ) ) )
{
// skip features without geometry
if ( !P->mFetchFeaturesWithoutGeom && !OGR_F_GetGeometryRef( fet ) )
{
OGR_F_Destroy( fet );
continue;
}

if ( !readFeature( fet, feature ) )
continue;

0 comments on commit 94639ee

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