Remove unnecessary map-event callback in wxGTK wxFileDialog

Calling gtk_file_chooser_set_show_hidden() directly from Create() works
just as well and is simpler and shorter.

See https://github.com/wxWidgets/wxWidgets/pull/1413
This commit is contained in:
Vadim Zeitlin 2019-07-16 20:11:34 +02:00
parent 8748a476c3
commit e21c4c78ca

View File

@ -151,21 +151,6 @@ static void gtk_filedialog_update_preview_callback(GtkFileChooser *chooser,
} // extern "C"
extern "C"
{
static gboolean gtk_frame_map_callback( GtkFileChooser *file_chooser,
GdkEvent * WXUNUSED(event),
wxFileDialog *dlg )
{
/* if ( dlg->GetWindowStyle() & wxFD_SHOW_HIDDEN )
gtk_file_chooser_set_show_hidden( file_chooser, TRUE );
else
gtk_file_chooser_set_show_hidden( file_chooser, FALSE );*/
gtk_file_chooser_set_show_hidden(file_chooser, dlg->HasFlag(wxFD_SHOW_HIDDEN));
return FALSE;
}
}
void wxFileDialog::AddChildGTK(wxWindowGTK* child)
{
// allow dialog to be resized smaller horizontally
@ -290,8 +275,6 @@ bool wxFileDialog::Create(wxWindow *parent, const wxString& message,
g_signal_connect (m_widget, "selection-changed",
G_CALLBACK (gtk_filedialog_selchanged_callback), this);
g_signal_connect (m_widget, "map_event",
G_CALLBACK (gtk_frame_map_callback), this);
// deal with extensions/filters
SetWildcard(wildCard);
@ -367,6 +350,9 @@ bool wxFileDialog::Create(wxWindow *parent, const wxString& message,
previewImage);
}
gtk_file_chooser_set_show_hidden(file_chooser,
style & wxFD_SHOW_HIDDEN ? TRUE : FALSE);
return true;
}