From 3e07effcf7529a76d765f354c885e59ee367f944 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 16 Apr 2007 18:24:04 +0000 Subject: [PATCH] call gtk_file_chooser_set_current_folder even if the default file name is empty (but default directory isn't) (bug 1701682) [backport from HEAD] git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@45502 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/filedlg.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/gtk/filedlg.cpp b/src/gtk/filedlg.cpp index 25a5ceba64..65cf3a2de6 100644 --- a/src/gtk/filedlg.cpp +++ b/src/gtk/filedlg.cpp @@ -234,17 +234,14 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message, fn.AssignDir(defaultDir); // set the initial file name and/or directory - wxString fname = fn.GetFullName(); - if ( fname.empty() ) + const wxString dir = fn.GetPath(); + if ( !dir.empty() ) { - wxString dir = fn.GetPath(); - if ( !dir.empty() ) - { - gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget), - dir.fn_str()); - } + gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget), + dir.fn_str()); } + const wxString fname = fn.GetFullName(); if ( style & wxFD_SAVE ) { if ( !fname.empty() )