Skip to content
Permalink
Browse files

Fix broken QgsFeatureStore::setFields method

Was setting fields only on temporary copies of the features, not
the stored features themselves
  • Loading branch information
nyalldawson committed Sep 9, 2015
1 parent f628ebd commit 910cb01698b8c49292335e95fcf1847eb464fdae
Showing with 5 additions and 4 deletions.
  1. +1 −1 python/core/qgsfeaturestore.sip
  2. +3 −2 src/core/qgsfeaturestore.cpp
  3. +1 −1 src/core/qgsfeaturestore.h
@@ -19,7 +19,7 @@ class QgsFeatureStore
/** Get fields list */
QgsFields& fields();

/** Set fields. Resets feauters fields to pointer to new internal fields. */
/** Set fields. Resets feature's fields to pointer to new internal fields. */
void setFields( const QgsFields & fields );

/** Get crs */
@@ -40,9 +40,10 @@ QgsFeatureStore::~QgsFeatureStore()
void QgsFeatureStore::setFields( const QgsFields & fields )
{
mFields = fields;
Q_FOREACH ( QgsFeature feature, mFeatures )
QgsFeatureList::iterator it = mFeatures.begin();
for ( ; it != mFeatures.end(); ++it )
{
feature.setFields( mFields );
( *it ).setFields( mFields );
}
}

@@ -45,7 +45,7 @@ class CORE_EXPORT QgsFeatureStore
/** Get fields list */
QgsFields& fields() { return mFields; }

/** Set fields. Resets feauters fields to pointer to new internal fields. */
/** Set fields. Resets feature's fields to pointer to new internal fields. */
void setFields( const QgsFields & fields );

/** Get crs */

0 comments on commit 910cb01

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