[QGIS Commit] r8588 - trunk/qgis/src/app

svn_qgis at osgeo.org svn_qgis at osgeo.org
Wed Jun 4 12:54:15 EDT 2008


Author: jef
Date: 2008-06-04 12:54:14 -0400 (Wed, 04 Jun 2008)
New Revision: 8588

Modified:
   trunk/qgis/src/app/qgsuniquevaluedialog.cpp
Log:
use QgsVectorDataProvider::getUniqueValues() in unique value dialog again (was lost in r8440)

Modified: trunk/qgis/src/app/qgsuniquevaluedialog.cpp
===================================================================
--- trunk/qgis/src/app/qgsuniquevaluedialog.cpp	2008-06-04 15:01:25 UTC (rev 8587)
+++ trunk/qgis/src/app/qgsuniquevaluedialog.cpp	2008-06-04 16:54:14 UTC (rev 8588)
@@ -292,29 +292,19 @@
   QgsVectorDataProvider *provider = dynamic_cast<QgsVectorDataProvider *>(mVectorLayer->getDataProvider());
   if (provider)
   {
-    QString value;
-    QgsAttributeList attlist;
-
     int nr = provider->indexFromFieldName(attributeName);
     if(nr == -1)
     {
       return;
     }
-    attlist.append(nr);
 
-    provider->select(attlist, QgsRect(), false);
-    QgsFeature feat;
+    QStringList values;
+    provider->getUniqueValues(nr, values);
 
-    //go through all the features and insert their value into the map and into mClassListWidget
-    while(provider->getNextFeature(feat)) 
+    for(int i=0; i<values.size(); i++)
     {
-      const QgsAttributeMap& attrs = feat.attributeMap();
-      value = attrs[nr].toString();
-
-      if( mValues.contains(value) )
-        continue;
-
-      addClass(value);
+      if( !mValues.contains(values[i]) )
+        addClass(values[i]);
     }
   }
 }



More information about the QGIS-commit mailing list