瀏覽代碼

wxGUI/startup: get the first possible grassdata match, not last (faster and more expected)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@73150 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 6 年之前
父節點
當前提交
693445e86e
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      gui/wxpython/gis_set.py

+ 3 - 2
gui/wxpython/gis_set.py

@@ -542,11 +542,11 @@ class GRASSStartup(wx.Frame):
             return
         home = os.path.expanduser('~')
         # try some common directories for grassdata
-        # always assuming grassdata (lowercase)
-        # home for Linux
+        # grassdata (lowercase) in home for Linux (first choice)
         # Documents and My Documents for Windows
         # potential translations (old Windows and some Linux)
         # but ~ and ~/Documents should cover most of the cases
+        # ordered by preference and then likelihood
         candidates = [
             os.path.join(home, "grassdata"),
             os.path.join(home, "Documents", "grassdata"),
@@ -563,6 +563,7 @@ class GRASSStartup(wx.Frame):
         for candidate in candidates:
             if os.path.exists(candidate):
                 path = candidate
+                break  # get the first match
         if path:
             try:
                 self.tgisdbase.SetValue(path)