]> git.saurik.com Git - wxWidgets.git/commitdiff
be user friendly on Unix and expand the / node automatically
authorVáclav Slavík <vslavik@fastmail.fm>
Mon, 18 Oct 2004 12:50:10 +0000 (12:50 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Mon, 18 Oct 2004 12:50:10 +0000 (12:50 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29966 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/dirctrlg.cpp

index 7a5d5a8d369d950febf2f131ac1ce8a8719c7346..791b3a97a0087fa59845e508c6fc536169d4edd1 100644 (file)
@@ -551,8 +551,19 @@ bool wxGenericDirCtrl::Create(wxWindow *parent,
     ExpandDir(m_rootId); // automatically expand first level
 
     // Expand and select the default path
-    if (!m_defaultPath.IsEmpty())
+    if (!m_defaultPath.empty())
+    {
         ExpandPath(m_defaultPath);
+    }
+#ifdef __UNIX__
+    else
+    {
+        // On Unix, there's only one node under the (hidden) root node. It
+        // represents the / path, so the user would always have to expand it;
+        // let's do it ourselves
+        ExpandPath(wxT("/"));
+    }
+#endif
 
     SetBestSize(size);
     DoResize();