From cf460a052a92b80d4b6f31bcd81d2f8816fcd89c Mon Sep 17 00:00:00 2001 From: raburton Date: Tue, 5 Jun 2007 17:43:34 +0000 Subject: [PATCH] fix my wx2.6 compatibility fix, found a problem after doing a full rebuild --- include/fctsys.h | 1 - kicad/treeprj_datas.cpp | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/fctsys.h b/include/fctsys.h index c00e94bdf2..2489cf5135 100644 --- a/include/fctsys.h +++ b/include/fctsys.h @@ -51,7 +51,6 @@ #define wxFD_OVERWRITE_PROMPT wxOVERWRITE_PROMPT #define WXK_PAGEUP WXK_PRIOR #define WXK_PAGEDOWN WXK_NEXT -#define wxRenameFile(a, b, c) wxRenameFile(a, b) #endif #ifdef __UNIX__ diff --git a/kicad/treeprj_datas.cpp b/kicad/treeprj_datas.cpp index 127963db7c..9a6a78f151 100644 --- a/kicad/treeprj_datas.cpp +++ b/kicad/treeprj_datas.cpp @@ -177,7 +177,11 @@ void TreePrjItemData::Move( TreePrjItemData * dest ) if ( destName == GetFileName() ) return; // Same place ?? // Move the file on the disk: +#if ( (wxMAJOR_VERSION < 2) || ((wxMAJOR_VERSION == 2)&& (wxMINOR_VERSION < 7)) ) + if ( !wxRenameFile( GetFileName(), destName ) ) +#else if ( !wxRenameFile( GetFileName(), destName, false ) ) +#endif { wxMessageDialog( m_Parent, _( "Unable to move file ... "), _( "Permission error ?" ), wxICON_ERROR | wxOK ); return; @@ -244,7 +248,11 @@ bool TreePrjItemData::Rename( const wxString & name, bool check ) if ( wxID_YES != dialog.ShowModal() ) return false; } +#if ( (wxMAJOR_VERSION < 2) || ((wxMAJOR_VERSION == 2)&& (wxMINOR_VERSION < 7)) ) + if (! wxRenameFile( m_FileName, newFile ) ) +#else if (! wxRenameFile( m_FileName, newFile, false ) ) +#endif { wxMessageDialog( m_Parent, _( "Unable to rename file ... "), _( "Permission error ?" ), wxICON_ERROR | wxOK ); return false;