diff --git a/src/gtk/filedlg.cpp b/src/gtk/filedlg.cpp index e6f6320b86..44087dd65e 100644 --- a/src/gtk/filedlg.cpp +++ b/src/gtk/filedlg.cpp @@ -15,6 +15,7 @@ #ifndef WX_PRECOMP #include "wx/intl.h" + #include "wx/log.h" #include "wx/msgdlg.h" #endif @@ -81,7 +82,11 @@ static void gtk_filedialog_ok_callback(GtkWidget *widget, wxFileDialog *dialog) { // Use chdir to not care about filename encodings wxGtkString folder(g_path_get_dirname(filename)); - chdir(folder); + if ( chdir(folder) != 0 ) + { + wxLogSysError(_("Changing current directory to \"%s\" failed"), + wxString::FromUTF8(folder)); + } } wxCommandEvent event(wxEVT_BUTTON, wxID_OK); diff --git a/src/gtk/filepicker.cpp b/src/gtk/filepicker.cpp index 3abea8d7cf..d8d0c6b01d 100644 --- a/src/gtk/filepicker.cpp +++ b/src/gtk/filepicker.cpp @@ -18,6 +18,10 @@ #if wxUSE_FILEPICKERCTRL +#ifndef WX_PRECOMP + #include "wx/log.h" +#endif + #include "wx/filepicker.h" #include "wx/tooltip.h" @@ -180,7 +184,13 @@ static void file_set(GtkFileChooser* widget, wxDirButton* p) // thus we need to make sure the current working directory is updated if wxDIRP_CHANGE_DIR // style was given. if (p->HasFlag(wxDIRP_CHANGE_DIR)) - chdir(filename); + { + if ( chdir(filename) != 0 ) + { + wxLogSysError(_("Changing current directory to \"%s\" failed"), + wxString::FromUTF8(filename)); + } + } // ...and fire an event wxFileDirPickerEvent event(wxEVT_DIRPICKER_CHANGED, p, p->GetId(), p->GetPath());