]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/filedlg.cpp
remove unnecessary gtk_widget_show(m_widget) calls, PostCreation() takes care of...
[wxWidgets.git] / src / gtk / filedlg.cpp
index 6ba83203126033ef0587a241c8b73c81c565316a..85118048ed0c0f70e5a6139042dd113425b39fed 100644 (file)
@@ -371,10 +371,17 @@ void wxFileDialog::SetMessage(const wxString& message)
 
 void wxFileDialog::SetPath(const wxString& path)
 {
+    // Don't do anything if no path is specified, in particular don't set the
+    // path to m_dir below as this would result in opening the dialog in the
+    // parent directory of this one instead of m_dir itself.
+    if ( path.empty() )
+        return;
+
     // 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());
 }