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:
@@ -228,7 +228,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
|
|||||||
wxConvFileName->cWX2MB(defaultDir));
|
wxConvFileName->cWX2MB(defaultDir));
|
||||||
|
|
||||||
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(m_widget),
|
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 GTK_CHECK_VERSION(2,7,3)
|
||||||
if ((style & wxFD_OVERWRITE_PROMPT) && !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 (!gtk_check_version(2,4,0))
|
||||||
{
|
{
|
||||||
if (HasFlag(wxFD_SAVE))
|
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
|
else
|
||||||
SetPath(wxFileName(GetDirectory(), name).GetFullPath());
|
SetPath(wxFileName(GetDirectory(), name).GetFullPath());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user