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()
292
292
QgsVectorDataProvider *provider = dynamic_cast <QgsVectorDataProvider *>(mVectorLayer ->getDataProvider ());
293
293
if (provider)
294
294
{
295
- QString value;
296
- QgsAttributeList attlist;
297
-
298
295
int nr = provider->indexFromFieldName (attributeName);
299
296
if (nr == -1 )
300
297
{
301
298
return ;
302
299
}
303
- attlist.append (nr);
304
300
305
- provider-> select (attlist, QgsRect (), false ) ;
306
- QgsFeature feat ;
301
+ QStringList values ;
302
+ provider-> getUniqueValues (nr, values) ;
307
303
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++)
310
305
{
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]);
318
308
}
319
309
}
320
310
}
You can’t perform that action at this time.
0 commit comments