From 257d35aead848ef7ea2009c4291dd2499b9ae94f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 28 Feb 2012 02:04:57 +0000 Subject: [PATCH] Interpret default file name relatively to initial dir in wxGTK wxFileDialog. Use the initial dialog directory to build the absolute path required by GTK+ in wxFileDialog instead of the current working directory. This makes more sense and makes specifying the default directory and (just) the default file name work correctly and avoids GTK+ warnings like Gtk-CRITICAL **: gtk_file_folder_unix_get_info: assertion `strcmp (dirname, folder_unix->filename) == 0' failed (and in some older versions of GTK+ -- 2.10? -- this even results in a crash). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70731 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/filedlg.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gtk/filedlg.cpp b/src/gtk/filedlg.cpp index 6ba8320312..51dadd12ee 100644 --- a/src/gtk/filedlg.cpp +++ b/src/gtk/filedlg.cpp @@ -372,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()); } -- 2.45.2