Don't use filename encoding conversion when passing string to gtk_file_chooser_set_current_name (save as dialog

suggested filename) - it takes a UTF-8 per gtk+ documentation and common sense, so use wxGTK_CONV instead.
Fixes wxFileDialog save mode default filename with non-utf8 G_FILENAME_ENCODING (bug #1497800). Thanks to
Konstantin Anory for pointing this out.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40388 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mart Raudsepp
2006-07-31 00:35:08 +00:00
parent 6a06841c34
commit f0f1afb8b9

View File

@@ -228,7 +228,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
wxConvFileName->cWX2MB(defaultDir));
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(m_widget),
wxConvFileName->cWX2MB(defaultFileName));
wxGTK_CONV(defaultFileName));
#if GTK_CHECK_VERSION(2,7,3)
if ((style & wxFD_OVERWRITE_PROMPT) && !gtk_check_version(2,7,3))
@@ -401,7 +401,7 @@ void wxFileDialog::SetFilename(const wxString& name)
if (!gtk_check_version(2,4,0))
{
if (HasFlag(wxFD_SAVE))
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(m_widget), wxConvFileName->cWX2MB(name));
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(m_widget), wxGTK_CONV(name));
else
SetPath(wxFileName(GetDirectory(), name).GetFullPath());
}