File tree Expand file tree Collapse file tree 1 file changed +5
-15
lines changed Expand file tree Collapse file tree 1 file changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -292,29 +292,19 @@ void QgsUniqueValueDialog::changeClassificationAttribute()
292292 QgsVectorDataProvider *provider = dynamic_cast <QgsVectorDataProvider *>(mVectorLayer ->getDataProvider ());
293293 if (provider)
294294 {
295- QString value;
296- QgsAttributeList attlist;
297-
298295 int nr = provider->indexFromFieldName (attributeName);
299296 if (nr == -1 )
300297 {
301298 return ;
302299 }
303- attlist.append (nr);
304300
305- provider-> select (attlist, QgsRect (), false ) ;
306- QgsFeature feat ;
301+ QStringList values ;
302+ provider-> getUniqueValues (nr, values) ;
307303
308- // go through all the features and insert their value into the map and into mClassListWidget
309- while (provider->getNextFeature (feat))
304+ for (int i=0 ; i<values.size (); i++)
310305 {
311- const QgsAttributeMap& attrs = feat.attributeMap ();
312- value = attrs[nr].toString ();
313-
314- if ( mValues .contains (value) )
315- continue ;
316-
317- addClass (value);
306+ if ( !mValues .contains (values[i]) )
307+ addClass (values[i]);
318308 }
319309 }
320310}
You can’t perform that action at this time.
0 commit comments