From e21c4c78ca5c04bf9872478087cca3b53669b39e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 16 Jul 2019 20:11:34 +0200 Subject: [PATCH] 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 --- src/gtk/filedlg.cpp | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/gtk/filedlg.cpp b/src/gtk/filedlg.cpp index d6dd123ac7..9f5ae2beb9 100644 --- a/src/gtk/filedlg.cpp +++ b/src/gtk/filedlg.cpp @@ -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; }