Explorar o código

wxGUI: fix and use fast v.category option

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@55942 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz %!s(int64=12) %!d(string=hai) anos
pai
achega
ce2b50090d
Modificáronse 2 ficheiros con 3 adicións e 20 borrados
  1. 1 2
      gui/wxpython/core/utils.py
  2. 2 18
      gui/wxpython/gui_core/gselect.py

+ 1 - 2
gui/wxpython/core/utils.py

@@ -310,8 +310,7 @@ def GetVectorNumberOfLayers(vector):
                                getErrorMsg = True,
                                read = True,
                                input = fullname,
-                               option = 'layers',
-                               sep = ';')
+                               option = 'layers')
     if ret != 0:
         sys.stderr.write(_("Vector map <%(map)s>: %(msg)s\n") % { 'map' : fullname, 'msg' : msg })
         return layers

+ 2 - 18
gui/wxpython/gui_core/gselect.py

@@ -58,6 +58,7 @@ from gui_core.widgets  import ManageSettingsWidget
 from core.gcmd     import RunCommand, GError, GMessage
 from core.utils    import GetListOfLocations, GetListOfMapsets, GetFormats
 from core.utils    import GetSettingsPath, GetValidLayerName, ListSortLower
+from core.utils    import GetVectorNumberOfLayers
 from core.settings import UserSettings
 from core.debug    import Debug
 
@@ -815,24 +816,7 @@ class LayerSelect(wx.ComboBox):
             layers.append('-1')
 
         if vector:
-            ret = RunCommand('v.category',
-                             read = True,
-                             quiet = True,
-                             option = 'report',
-                             flags = 'g',
-                             input = vector)
-            if ret:
-                for line in ret.splitlines():
-                    if 'all' not in line:
-                        continue
-                    try:
-                        layer = line.split(' ')[0]
-                    except IndexError:
-                        continue
-                    # use this to get layer names
-                    # but only when all modules use Vect_get_field2()
-                    # which is not the case right now
-                    layers.append(layer)
+	    layers = GetVectorNumberOfLayers(vector)
 
         elif dsn:
             ret = RunCommand('v.in.ogr',