Skip to content
Permalink
Browse files

get uniquie values from provider instead of using own function

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15320 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
alexbruy
alexbruy committed Mar 3, 2011
1 parent b4ea9e2 commit fbfca24fc8b7c827842c190dd85826b207b8cf4b
Showing with 2 additions and 10 deletions.
  1. +2 −10 python/plugins/fTools/tools/ftools_utils.py
@@ -203,7 +203,7 @@ def getVectorLayerByName( myName ):
return layer
else:
return None

# Return QgsMapLayer from a layer name ( as string )
def getMapLayerByName( myName ):
layermap = QgsMapLayerRegistry.instance().mapLayers()
@@ -249,15 +249,7 @@ def addShapeToCanvas( shapefile_path ):

# Return all unique values in field based on field index
def getUniqueValues( provider, index ):
allAttrs = provider.attributeIndexes()
provider.select( allAttrs )
f = QgsFeature()
values = []
check = []
while provider.nextFeature( f ):
if not f.attributeMap()[ index ].toString() in check:
values.append( f.attributeMap()[ index ] )
check.append( f.attributeMap()[ index ].toString() )
values = provider.uniqueValues( index )
return values

# Generate a save file dialog with a dropdown box for choosing encoding style

0 comments on commit fbfca24

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