X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/33a5660422db882043cea77bd0d6e663df70c5bf..a9efc294a979fb4ae801f7dc37af35677301212d:/src/gtk/filectrl.cpp diff --git a/src/gtk/filectrl.cpp b/src/gtk/filectrl.cpp index 5beb5a438e..8bc3a2d0c9 100644 --- a/src/gtk/filectrl.cpp +++ b/src/gtk/filectrl.cpp @@ -16,7 +16,7 @@ #include "wx/filectrl.h" -#if defined(__WXGTK24__) && !defined(__WXUNIVERSAL__) +#if wxUSE_FILECTRL && !defined(__WXUNIVERSAL__) #ifndef WX_PRECOMP # include "wx/sizer.h" @@ -369,18 +369,13 @@ bool wxGtkFileCtrl::SetDirectory( const wxString& dir ) bool wxGtkFileCtrl::SetFilename( const wxString& name ) { - if ( !gtk_check_version( 2, 4, 0 ) ) + if ( HasFlag( wxFC_SAVE ) ) { - if ( HasFlag( wxFC_SAVE ) ) - { - gtk_file_chooser_set_current_name( m_fcWidget, wxGTK_CONV( name ) ); - return true; - } - else - return SetPath( wxFileName( GetDirectory(), name ).GetFullPath() ); + gtk_file_chooser_set_current_name( m_fcWidget, wxGTK_CONV( name ) ); + return true; } - - return false; + else + return SetPath( wxFileName( GetDirectory(), name ).GetFullPath() ); } void wxGtkFileCtrl::SetWildcard( const wxString& wildCard ) @@ -422,16 +417,10 @@ void wxGtkFileCtrl::GetFilenames( wxArrayString& files ) const void wxGtkFileCtrl::ShowHidden(bool show) { -#ifdef __WXGTK26__ - gtk_file_chooser_set_show_hidden(m_fcWidget, show); -#else - // gtk_file_chooser_set_show_hidden only in 2.6 + // gtk_file_chooser_set_show_hidden() is new in 2.6 g_object_set (G_OBJECT (m_fcWidget), "show-hidden", show, NULL); -#endif } -#endif - // wxUSE_FILECTRL +#endif // wxUSE_FILECTRL -#endif - // if defined(__WXGTK24__) && !defined(__WXUNIVERSAL__) +#endif // wxUSE_FILECTRL && !defined(__WXUNIVERSAL__)