]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/filedlg.cpp
remove run-time check for now-required GTK 2.4
[wxWidgets.git] / src / gtk / filedlg.cpp
index a9359fa3ff092bad20e97cff9828105ce0a56b2c..51dadd12ee5fce38a58864aa96c7b3f53222a43d 100644 (file)
@@ -22,7 +22,9 @@
 #include <gtk/gtk.h>
 #include "wx/gtk/private.h"
 
+#ifdef __UNIX__
 #include <unistd.h> // chdir
+#endif
 
 #include "wx/filename.h" // wxFilename
 #include "wx/tokenzr.h" // wxStringTokenizer
@@ -370,9 +372,10 @@ void wxFileDialog::SetMessage(const wxString& message)
 void wxFileDialog::SetPath(const wxString& path)
 {
     // we need an absolute path for GTK native chooser so ensure that we have
-    // it
+    // it: use the initial directory if it was set or just CWD otherwise (this
+    // is the default behaviour if m_dir is empty)
     wxFileName fn(path);
-    fn.MakeAbsolute();
+    fn.MakeAbsolute(m_dir);
     m_fc.SetPath(fn.GetFullPath());
 }