Bläddra i källkod

wxGUI/settings: fix https://trac.osgeo.org/grass/changeset/52719 - check also subkey

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@52721 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 12 år sedan
förälder
incheckning
90c2a80695
1 ändrade filer med 6 tillägg och 0 borttagningar
  1. 6 0
      gui/wxpython/core/settings.py

+ 6 - 0
gui/wxpython/core/settings.py

@@ -1093,6 +1093,7 @@ class Settings:
         @param value value
         @param overwrite True to overwrite existing value
         """
+
         hasValue = True
         if group not in dict:
             dict[group] = {}
@@ -1107,6 +1108,8 @@ class Settings:
             if subkey[0] not in dict[group][key]:
                 dict[group][key][subkey[0]] = {}
                 hasValue = False
+            if subkey[1] not in dict[group][key][subkey[0]]:
+                hasValue = False
             
             try:
                 if overwrite or (not overwrite and not hasValue):
@@ -1115,6 +1118,9 @@ class Settings:
                 print >> sys.stderr, _("Unable to parse settings '%s'") % value + \
                     ' (' + group + ':' + key + ':' + subkey[0] + ':' + subkey[1] + ')'
         else:
+            if subkey not in dict[group][key]:
+                hasValue = False
+            
             try:
                 if overwrite or (not overwrite and not hasValue):
                     dict[group][key][subkey] = value