[Qgis-developer] QgsVectorLayer.addedFeatures

Stefanie Tellex stefie10 at media.mit.edu
Wed Nov 5 11:38:32 EST 2008


Hi,

I haven't synced my code with the trunk in a few months, so I was
updating, and I noticed that QgsVectorLayer.addedFeatures went away.  I
was using it to make placeholder layers that never got committed to the
database.

The attached patch (against r9563) adds it back.  I'd be happier if it
was applied, but I suppose there was a reason it got removed in the
first place?

Thanks,

Stefanie

-------------- next part --------------
Index: qgis/qgis_unstable/python/core/qgsvectorlayer.sip
===================================================================
--- qgis.orig/qgis_unstable/python/core/qgsvectorlayer.sip	2008-11-05 11:11:10.000000000 -0500
+++ qgis/qgis_unstable/python/core/qgsvectorlayer.sip	2008-11-05 11:12:30.000000000 -0500
@@ -72,6 +72,8 @@
 
   /** Get a copy of the user-selected features */  
   QList<QgsFeature> selectedFeatures();
+
+  QList<QgsFeature> addedFeatures();
   
   /** Return reference to identifiers of selected features */
   const QSet<int>& selectedFeaturesIds() const;
Index: qgis/qgis_unstable/src/core/qgsvectorlayer.cpp
===================================================================
--- qgis.orig/qgis_unstable/src/core/qgsvectorlayer.cpp	2008-11-05 11:11:05.000000000 -0500
+++ qgis/qgis_unstable/src/core/qgsvectorlayer.cpp	2008-11-05 11:12:14.000000000 -0500
@@ -3011,7 +3011,10 @@
   return mSelectedFeatureIds;
 }
 
-
+QgsFeatureList QgsVectorLayer::addedFeatures()
+{
+  return mAddedFeatures;
+}
 QgsFeatureList QgsVectorLayer::selectedFeatures()
 {
   if ( !mDataProvider )
Index: qgis/qgis_unstable/src/core/qgsvectorlayer.h
===================================================================
--- qgis.orig/qgis_unstable/src/core/qgsvectorlayer.h	2008-11-05 11:11:03.000000000 -0500
+++ qgis/qgis_unstable/src/core/qgsvectorlayer.h	2008-11-05 11:14:21.000000000 -0500
@@ -133,6 +133,8 @@
     /** Get a copy of the user-selected features */
     QgsFeatureList selectedFeatures();
 
+    QgsFeatureList addedFeatures();
+
     /** Return reference to identifiers of selected features */
     const QgsFeatureIds& selectedFeaturesIds() const;
 



More information about the Qgis-developer mailing list