Skip to content
Permalink
Browse files

use QgsVectorDataProvider::getUniqueValues() in unique value dialog a…

…gain (was lost in r8440)

git-svn-id: http://svn.osgeo.org/qgis/trunk@8588 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Jun 4, 2008
1 parent 465772f commit d8c475d50f6de5c6fe309925e70b08486b9340e1
Showing with 5 additions and 15 deletions.
  1. +5 −15 src/app/qgsuniquevaluedialog.cpp
@@ -292,29 +292,19 @@ void QgsUniqueValueDialog::changeClassificationAttribute()
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]);
}
}
}

0 comments on commit d8c475d

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