Ticket #8272: filezilla-3.8.1-rc3_wxWidgets-3.0.diff
File filezilla-3.8.1-rc3_wxWidgets-3.0.diff, 33.8 KB (added by , 9 years ago) |
---|
-
configure
http://trac.filezilla-project.org/ticket/8272
old new PACKAGE_VERSION_MAJOR 691 691 WINDRESFLAGS 692 692 WINDRES 693 693 WX_CONFIG_WITH_ARGS 694 WX_VERSION_MICRO 695 WX_VERSION_MINOR 696 WX_VERSION_MAJOR 694 697 WX_RESCOMP 695 698 WX_VERSION 696 699 WX_LIBS_STATIC … … $as_echo_n "checking for wxWidgets version >= $min_wx_version... " >&6; } 16042 16045 $as_echo_n "checking for wxWidgets version >= $min_wx_version (--unicode=yes --universal=no)... " >&6; } 16043 16046 fi 16044 16047 16045 WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args --unicode=yes --universal=no aui,xrc,adv,core,xml,net,base"16048 WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args --unicode=yes --universal=no" 16046 16049 16047 16050 WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null` 16048 16051 wx_config_major_version=`echo $WX_VERSION | \ … … $as_echo_n "checking for wxWidgets version >= $min_wx_version (--unicode=yes --u 16081 16084 16082 16085 16083 16086 if test -n "$wx_ver_ok"; then 16084 16085 16087 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $WX_VERSION)" >&5 16086 16088 $as_echo "yes (version $WX_VERSION)" >&6; } 16087 WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs `16089 WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs aui,html,xrc,adv,core,xml,net,base` 16088 16090 16089 16091 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wxWidgets static library" >&5 16090 16092 $as_echo_n "checking for wxWidgets static library... " >&6; } 16091 WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs 2>/dev/null`16093 WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs aui,html,xrc,adv,core,xml,net,base 2>/dev/null` 16092 16094 if test "x$WX_LIBS_STATIC" = "x"; then 16093 16095 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 16094 16096 $as_echo "no" >&6; } … … $as_echo "yes" >&6; } 16131 16133 fi 16132 16134 16133 16135 if test "x$wx_has_cppflags" = x ; then 16134 WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags `16136 WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags aui,html,xrc,adv,core,xml,net,base` 16135 16137 WX_CPPFLAGS=$WX_CFLAGS 16136 16138 WX_CXXFLAGS=$WX_CFLAGS 16137 16139 16138 16140 WX_CFLAGS_ONLY=$WX_CFLAGS 16139 16141 WX_CXXFLAGS_ONLY=$WX_CFLAGS 16140 16142 else 16141 WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags `16142 WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags `16143 WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags `16143 WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags aui,html,xrc,adv,core,xml,net,base` 16144 WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags aui,html,xrc,adv,core,xml,net,base` 16145 WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags aui,html,xrc,adv,core,xml,net,base` 16144 16146 16145 16147 WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"` 16146 16148 WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"` … … $as_echo "no (version $WX_VERSION is not new enough)" >&6; } 16164 16166 WX_LIBS="" 16165 16167 WX_LIBS_STATIC="" 16166 16168 WX_RESCOMP="" 16167 : 16169 16170 if test ! -z "--unicode=yes --universal=no"; then 16171 16172 wx_error_message=" 16173 The configuration you asked for $PACKAGE_NAME requires a wxWidgets 16174 build with the following settings: 16175 --unicode=yes --universal=no 16176 but such build is not available. 16177 16178 To see the wxWidgets builds available on this system, please use 16179 'wx-config --list' command. To use the default build, returned by 16180 'wx-config --selected-config', use the options with their 'auto' 16181 default values." 16182 16183 fi 16184 16185 wx_error_message=" 16186 The requested wxWidgets build couldn't be found. 16187 $wx_error_message 16188 16189 If you still get this error, then check that 'wx-config' is 16190 in path, the directory where wxWidgets libraries are installed 16191 (returned by 'wx-config --libs' command) is in LD_LIBRARY_PATH 16192 or equivalent variable and wxWidgets version is $MIN_WX_VERSION or above." 16193 16194 as_fn_error $? "$wx_error_message" "$LINENO" 5 16168 16195 16169 16196 fi 16170 16197 else … … $as_echo "no (version $WX_VERSION is not new enough)" >&6; } 16190 16217 16191 16218 16192 16219 16220 WX_VERSION_MAJOR="$wx_config_major_version" 16221 WX_VERSION_MINOR="$wx_config_minor_version" 16222 WX_VERSION_MICRO="$wx_config_micro_version" 16223 16224 16225 16226 16193 16227 if test "$wxWin" != 1; then 16194 16228 as_fn_error $? " 16195 16229 wxWidgets must be installed on your system … … $as_echo "no (version $WX_VERSION is not new enough)" >&6; } 16205 16239 equivalent variable and wxWidgets version is $MIN_WX_VERSION or above. 16206 16240 " "$LINENO" 5 16207 16241 fi 16208 if test "$wx_config_major_version" -gt "2" || test "$wx_config_minor_version" -gt "8"; then16209 as_fn_error $? "You need to use wxWidgets 2.8.x to compile this program." "$LINENO" 516210 fi16211 16242 16212 16243 # --universal=no doesn't work correctly, it still accepts universal builds. Reject it manually here. 16213 16244 if echo "$WX_CPPFLAGS" | grep __WXUNIVERSAL__ > /dev/null; then -
src/engine/local_path.cpp
old new bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/) 48 48 49 49 wxChar* out; 50 50 wxChar* start; 51 wxStringBuffer* buffer = 0; 51 52 if (*in == '\\') 52 53 { 53 54 // possibly UNC … … bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/) 59 60 return false; 60 61 } 61 62 62 start = m_path.GetWriteBuf(path.Len() + 2); 63 buffer = new wxStringBuffer(m_path, path.Len() + 2); 64 start = *buffer; 63 65 out = start; 64 66 *out++ = '\\'; 65 67 *out++ = '\\'; … … bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/) 77 79 { 78 80 // not a valid UNC path 79 81 *start = 0; 80 m_path.UngetWriteBuf( 0 );82 delete buffer; 81 83 return false; 82 84 } 83 85 … … bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/) 87 89 { 88 90 // Regular path 89 91 90 start = m_path.GetWriteBuf(path.Len() + 2); 92 buffer = new wxStringBuffer(m_path, path.Len() + 2); 93 start = *buffer; 91 94 out = start; 92 95 *out++ = *in++; 93 96 94 97 if (*in++ != ':') 95 98 { 96 99 *start = 0; 97 m_path.UngetWriteBuf( 0 );100 delete buffer; 98 101 return false; 99 102 } 100 103 *out++ = ':'; 101 104 if (*in != '/' && *in != '\\' && *in) 102 105 { 103 106 *start = 0; 104 m_path.UngetWriteBuf( 0 );107 delete buffer; 105 108 return false; 106 109 } 107 110 *out++ = path_separator; … … bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/) 120 123 return false; 121 124 } 122 125 126 #if wxCHECK_VERSION(2, 9, 0) 127 wxStringBuffer* buffer = new wxStringBuffer(m_path, path.Len() + 2); 128 wxChar* out = *buffer; 129 #else 123 130 wxChar* start = m_path.GetWriteBuf(path.Len() + 2); 124 131 wxChar* out = start; 132 #endif 125 133 126 134 *out++ = '/'; 127 135 segments.push_back(out); … … bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/) 210 218 } 211 219 212 220 *out = 0; 213 221 #if !wxCHECK_VERSION(2, 9, 0) 214 222 m_path.UngetWriteBuf( out - start ); 215 223 #else 224 if (buffer != 0) { 225 delete buffer; 226 } 227 #endif 216 228 ::Coalesce(m_path); 217 229 218 230 return true; -
src/engine/logging.cpp
old new CLogging::~CLogging() 51 51 } 52 52 } 53 53 54 #if wxCHECK_VERSION(2, 9, 0) 55 void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1) const 56 { 57 LogMessage(nMessageType, msgFormat, (const char*)(wxString() << value1).c_str()); 58 } 59 60 void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1, wxCStrData value2) const 61 { 62 LogMessage(nMessageType, msgFormat, (const char*)(wxString() << value1).c_str(), value2.AsWChar()); 63 } 64 65 void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1, wxCStrData value2, wxCStrData value3) const 66 { 67 LogMessage(nMessageType, msgFormat, (const char*)(wxString() << value1).c_str(), value2.AsWChar(), value3.AsWChar()); 68 } 69 70 void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1) const 71 { 72 LogMessage(nMessageType, msgFormat, value1.AsWChar()); 73 } 74 75 void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2) const 76 { 77 LogMessage(nMessageType, msgFormat, value1.AsWChar(), value2.AsWChar()); 78 } 79 80 void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2, wxCStrData value3, wxCStrData value4) const 81 { 82 LogMessage(nMessageType, msgFormat, value1.AsWChar(), value2.AsWChar(), value3.AsWChar(), value4.AsWChar()); 83 } 84 85 void CLogging::LogMessage(wxString sourceFile, int nSourceLine, void *pInstance, MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1) const 86 { 87 LogMessage(sourceFile, nSourceLine, pInstance, nMessageType, msgFormat, value1.AsWChar()); 88 } 89 #endif 90 54 91 void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, ...) const 55 92 { 56 93 InitLogFile(); -
src/engine/logging_private.h
old new public: 7 7 CLogging(CFileZillaEnginePrivate *pEngine); 8 8 virtual ~CLogging(); 9 9 10 #if wxCHECK_VERSION(2, 9, 0) 11 void LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1) const; 12 void LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1, wxCStrData value2) const; 13 void LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1, wxCStrData value2, wxCStrData value3) const; 14 void LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1) const; 15 void LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2) const; 16 void LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2, wxCStrData value3, wxCStrData value4) const; 17 void LogMessage(wxString sourceFile, int nSourceLine, void *pInstance, MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1) const; 18 #endif 19 10 20 void LogMessage(MessageType nMessageType, const wxChar *msgFormat, ...) const; 11 21 void LogMessageRaw(MessageType nMessageType, const wxChar *msg) const; 12 22 void LogMessage(wxString sourceFile, int nSourceLine, void *pInstance, MessageType nMessageType, const wxChar *msgFormat, ...) const; -
src/engine/misc.cpp
old new void MakeLowerAscii(wxString& str) 349 349 { 350 350 for (size_t i = 0; i < str.Len(); i++) 351 351 { 352 #if wxCHECK_VERSION(2, 9, 0) 353 char c; 354 str.GetChar(i).GetAsChar(&c); 355 if (c >= 'A' && c <= 'Z') 356 { 357 c += 32; 358 str.SetChar(i, wxUniChar(c)); 359 } else if (c == 0x130 || c == 0x131) { 360 c = 'i'; 361 str.SetChar(i, wxUniChar(c)); 362 } 363 #else 352 364 wxChar& c = str[i]; 353 365 if (c >= 'A' && c <= 'Z') 354 366 c += 32; 355 367 else if (c == 0x130 || c == 0x131) 356 368 c = 'i'; 369 #endif 357 370 } 358 371 } 359 372 -
src/engine/server.cpp
old new struct t_protocolInfo 12 12 }; 13 13 14 14 static const t_protocolInfo protocolInfos[] = { 15 { FTP, _T("ftp"), false, 21, true, wxTRANSLATE("FTP - File Transfer Protocol with optional encryption"),true },15 { FTP, _T("ftp"), false, 21, true, _T("FTP - File Transfer Protocol with optional encryption"), true }, 16 16 { SFTP, _T("sftp"), true, 22, false, _T("SFTP - SSH File Transfer Protocol"), false }, 17 17 { HTTP, _T("http"), true, 80, false, _T("HTTP - Hypertext Transfer Protocol"), false }, 18 { HTTPS, _T("https"), true, 443, true, wxTRANSLATE("HTTPS - HTTP over TLS"),false },19 { FTPS, _T("ftps"), true, 990, true, wxTRANSLATE("FTPS - FTP over implicit TLS/SSL"),true },20 { FTPES, _T("ftpes"), true, 21, true, wxTRANSLATE("FTPES - FTP over explicit TLS/SSL"),true },21 { INSECURE_FTP, _T("ftp"), false, 21, true, wxTRANSLATE("FTP - Insecure File Transfer Protocol"),true },18 { HTTPS, _T("https"), true, 443, true, _T("HTTPS - HTTP over TLS"), false }, 19 { FTPS, _T("ftps"), true, 990, true, _T("FTPS - FTP over implicit TLS/SSL"), true }, 20 { FTPES, _T("ftpes"), true, 21, true, _T("FTPES - FTP over explicit TLS/SSL"), true }, 21 { INSECURE_FTP, _T("ftp"), false, 21, true, _T("FTP - Insecure File Transfer Protocol"), true }, 22 22 { UNKNOWN, _T(""), false, 21, false, _T(""), false } 23 23 }; 24 24 -
src/engine/serverpath.cpp
old new wxString CServerPath::GetSafePath() const 258 258 len += iter->Length() + 2 + INTLENGTH; 259 259 260 260 wxString safepath; 261 #if wxCHECK_VERSION(2, 9, 0) 262 wxStringBuffer* buffer = new wxStringBuffer(safepath, len); 263 wxChar* t = *buffer; 264 #else 261 265 wxChar* start = safepath.GetWriteBuf(len); 262 266 wxChar* t = start; 267 #endif 263 268 264 269 t = fast_sprint_number(t, m_type); 265 270 *(t++) = ' '; … … wxString CServerPath::GetSafePath() const 281 286 t += iter->size(); 282 287 } 283 288 *t = 0; 284 289 #if !wxCHECK_VERSION(2, 9, 0) 285 290 safepath.UngetWriteBuf( t - start ); 291 #else 292 delete buffer; 293 #endif 286 294 safepath.Shrink(); 287 295 288 296 return safepath; -
src/engine/socket.cpp
old new void CSocket::SetEventHandler(CSocketEventHandler* pEvtHandler) 1187 1187 } 1188 1188 } 1189 1189 1190 #define ERRORDECL(c, desc) { c, _T(#c), wxTRANSLATE(desc) },1190 #define ERRORDECL(c, desc) { c, _T(#c), _T(desc) }, 1191 1191 1192 1192 struct Error_table 1193 1193 { -
src/engine/string_coalescer.cpp
old new struct fast_equal 67 67 { 68 68 // wxString is CoW, yet it doesn't even do this fast pointer 69 69 // comparison in its less and/or equal operator(s). 70 #if wxCHECK_VERSION(2, 9, 0) 71 return lhs == rhs; 72 #else 70 73 return lhs.c_str() == rhs.c_str() || lhs == rhs; 74 #endif 71 75 } 72 76 }; 73 77 -
src/include/libfilezilla.h
old new 21 21 #include <wx/datetime.h> 22 22 #include <wx/event.h> 23 23 #include <wx/string.h> 24 #if wxCHECK_VERSION(2, 9, 0) 25 #include <wx/translation.h> 26 #include <wx/dcclient.h> 27 #endif 24 28 25 29 #include <list> 26 30 #include <vector> -
src/interface/FileZilla.cpp
old new bool CFileZillaApp::OnInit() 269 269 #else 270 270 if (!pInfo || !SetLocale(pInfo->Language)) 271 271 { 272 if (pInfo && pInfo->Description)272 if (pInfo && !pInfo->Description.IsEmpty()) 273 273 wxMessageBoxEx(wxString::Format(_("Failed to set language to %s (%s), using default system language"), pInfo->Description.c_str(), language.c_str()), _("Failed to change language"), wxICON_EXCLAMATION); 274 274 else 275 275 wxMessageBoxEx(wxString::Format(_("Failed to set language to %s, using default system language"), language.c_str()), _("Failed to change language"), wxICON_EXCLAMATION); … … void CFileZillaApp::CheckExistsFzsftp() 694 694 if (!wxFileName::FileExists(executable)) 695 695 { 696 696 wxMessageBoxEx(wxString::Format(_("%s could not be found. Without this component of FileZilla, SFTP will not work.\n\nPlease download FileZilla again. If this problem persists, please submit a bug report."), executable.c_str()), 697 _("File not found"), wxICON_ERROR );697 _("File not found"), wxICON_ERROR | wxOK); 698 698 executable.clear(); 699 699 } 700 700 -
src/interface/Mainfrm.cpp
old new void CMainFrame::OnMenuHandler(wxCommandEvent &event) 759 759 // Do a crude approach: Drop everything unexpected... 760 760 for (unsigned int i = 0; i < version.Len(); i++) 761 761 { 762 #if wxCHECK_VERSION(2, 9, 0) 763 char c; 764 version.GetChar(i).GetAsChar(&c); 765 #else 762 766 wxChar& c = version[i]; 767 #endif 763 768 if ((version[i] >= '0' && version[i] <= '9') || 764 769 (version[i] >= 'a' && version[i] <= 'z') || 765 770 (version[i] >= 'A' && version[i] <= 'Z') || 766 771 version[i] == '-' || version[i] == '.' || 767 772 version[i] == '_') 768 773 { 769 url += c;774 url.Append(c); 770 775 } 771 776 } 772 777 } … … void CMainFrame::OnMenuHandler(wxCommandEvent &event) 784 789 { 785 790 pStatusBar->Show(show); 786 791 wxSizeEvent evt; 792 #if wxCHECK_VERSION(2, 9, 0) 793 controls->pLocalListViewPanel->ProcessWindowEvent(evt); 794 #else 787 795 controls->pLocalListViewPanel->ProcessEvent(evt); 796 #endif 788 797 } 789 798 } 790 799 if (controls && controls->pRemoteListViewPanel) … … void CMainFrame::OnMenuHandler(wxCommandEvent &event) 794 803 { 795 804 pStatusBar->Show(show); 796 805 wxSizeEvent evt; 806 #if wxCHECK_VERSION(2, 9, 0) 807 controls->pRemoteListViewPanel->ProcessWindowEvent(evt); 808 #else 797 809 controls->pRemoteListViewPanel->ProcessEvent(evt); 810 #endif 798 811 } 799 812 } 800 813 } -
src/interface/QueueView.cpp
old new wxString CQueueView::ReplaceInvalidCharacters(const wxString& filename) 3443 3443 const wxChar replace = COptions::Get()->GetOption(OPTION_INVALID_CHAR_REPLACE)[0]; 3444 3444 3445 3445 wxString result; 3446 3446 #if wxCHECK_VERSION(2, 9, 0) 3447 wxStringBuffer* buffer = new wxStringBuffer(result, filename.Len() + 1); 3448 wxChar* buf = *buffer; 3449 #else 3447 3450 wxChar* start = result.GetWriteBuf(filename.Len() + 1); 3448 3451 wxChar* buf = start; 3452 #endif 3449 3453 3450 3454 const wxChar* p = filename.c_str(); 3451 3455 while (*p) … … wxString CQueueView::ReplaceInvalidCharacters(const wxString& filename) 3480 3484 p++; 3481 3485 } 3482 3486 *buf = 0; 3483 3487 #if wxCHECK_VERSION(2, 9, 0) 3488 delete buffer; 3489 #else 3484 3490 result.UngetWriteBuf( buf - start ); 3485 3491 #endif 3486 3492 return result; 3487 3493 } 3488 3494 -
src/interface/RemoteTreeView.cpp
old new void CRemoteTreeView::SetDirectoryListing(const CSharedPointer<const CDirectoryL 351 351 SetItemImages(parent, false); 352 352 353 353 #ifndef __WXMSW__ 354 m_freezeCount--;354 Thaw(); 355 355 #endif 356 356 if (!modified) 357 357 SafeSelectItem(parent); -
src/interface/StatusView.cpp
old new public: 71 71 { 72 72 wxWindow* parent = GetParent(); 73 73 event.SetEventObject(parent); 74 parent-> ProcessEvent(event);74 parent->GetEventHandler()->ProcessEvent(event); 75 75 } 76 76 #else 77 77 void OnKeyDown(wxKeyEvent& event) … … public: 89 89 navEvent.SetDirection(!event.ShiftDown()); 90 90 navEvent.SetFromTab(true); 91 91 navEvent.ResumePropagation(1); 92 parent-> ProcessEvent(navEvent);92 parent->GetEventHandler()->ProcessEvent(navEvent); 93 93 } 94 94 #endif 95 95 }; -
src/interface/aui_notebook_ex.cpp
old new 3 3 #include "aui_notebook_ex.h" 4 4 #include <wx/dcmirror.h> 5 5 6 #if wxCHECK_VERSION(2, 9, 0) 7 wxColor wxAuiStepColour(const wxColor& c, int ialpha) 8 { 9 wxColor* result = new wxColor(c); 10 result->ChangeLightness(ialpha); 11 return *result; 12 } 13 #else 6 14 wxColor wxAuiStepColour(const wxColor& c, int ialpha); 15 #endif 7 16 8 17 #ifdef __WXMSW__ 9 18 #define TABCOLOUR wxSYS_COLOUR_3DFACE … … public: 184 193 } 185 194 } 186 195 187 #ifdef __WXGTK__188 virtual GdkWindow* GetGDKWindow() const { return m_original_dc->GetGDKWindow(); }189 #endif190 196 protected: 191 197 int m_gradient_called; 192 198 int m_rectangle_called; … … public: 215 221 virtual wxAuiTabArt* Clone() 216 222 { 217 223 wxAuiTabArtEx *art = new wxAuiTabArtEx(m_pNotebook, m_bottom, m_data); 224 #if wxCHECK_VERSION(2, 9, 0) 225 art->SetNormalFont(m_normalFont); 226 art->SetSelectedFont(m_selectedFont); 227 art->SetMeasuringFont(m_measuringFont); 228 #else 218 229 art->SetNormalFont(m_normal_font); 219 230 art->SetSelectedFont(m_selected_font); 220 231 art->SetMeasuringFont(m_measuring_font); 232 #endif 221 233 return art; 222 234 } 223 235 … … public: 257 269 int* x_extent) 258 270 { 259 271 #ifndef __WXMAC__ 272 #if wxCHECK_VERSION(2, 9, 0) 273 m_baseColour = wxSystemSettings::GetColour(TABCOLOUR); 274 #else 260 275 m_base_colour = wxSystemSettings::GetColour(TABCOLOUR); 261 276 #endif 277 #endif 262 278 if (!pane.active) 263 279 { 280 #if wxCHECK_VERSION(2, 9, 0) 281 if (m_baseColour.Red() + m_baseColour.Green() + m_baseColour.Blue() >= 384) 282 m_baseColour = wxColour( m_baseColour.Red() * 0.95, m_baseColour.Green() * 0.95, m_baseColour.Blue() * 0.95 ); 283 #else 264 284 if (m_base_colour.Red() + m_base_colour.Green() + m_base_colour.Blue() >= 384) 265 285 m_base_colour = wxColour( m_base_colour.Red() * 0.95, m_base_colour.Green() * 0.95, m_base_colour.Blue() * 0.95 ); 286 #endif 266 287 267 288 dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); 268 289 if (m_pNotebook->Highlighted(m_pNotebook->GetPageIndex(pane.window))) … … public: 270 291 if (!m_fonts_initialized) 271 292 { 272 293 m_fonts_initialized = true; 294 #if wxCHECK_VERSION(2, 9, 0) 295 m_original_normal_font = m_normalFont; 296 m_highlighted_font = m_normalFont; 297 #else 273 298 m_original_normal_font = m_normal_font; 274 299 m_highlighted_font = m_normal_font; 300 #endif 275 301 m_highlighted_font.SetWeight(wxFONTWEIGHT_BOLD); 276 302 m_highlighted_font.SetStyle(wxFONTSTYLE_ITALIC); 277 303 } 304 #if wxCHECK_VERSION(2, 9, 0) 305 m_normalFont = m_highlighted_font; 306 #else 278 307 m_normal_font = m_highlighted_font; 308 #endif 279 309 } 280 310 else if (m_fonts_initialized) 311 #if wxCHECK_VERSION(2, 9, 0) 312 m_normalFont = m_original_normal_font; 313 #else 281 314 m_normal_font = m_original_normal_font; 315 #endif 282 316 } 283 317 #if wxCHECK_VERSION(2, 9, 0) 318 CFilterDC filter_dc(dc, pane.active ? 1 : 0, (m_tabCtrlHeight % 2) != 0, m_bottom); 319 wxAuiGenericTabArt::DrawTab(*((wxDC*)&filter_dc), wnd, pane, in_rect, close_button_state, out_tab_rect, out_button_rect, x_extent); 320 m_baseColour = wxSystemSettings::GetColour(TABCOLOUR); 321 #else 284 322 CFilterDC filter_dc(dc, pane.active ? 1 : 0, (m_tab_ctrl_height % 2) != 0, m_bottom); 285 323 wxAuiDefaultTabArt::DrawTab(*((wxDC*)&filter_dc), wnd, pane, in_rect, close_button_state, out_tab_rect, out_button_rect, x_extent); 286 287 324 m_base_colour = wxSystemSettings::GetColour(TABCOLOUR); 325 #endif 288 326 } 289 327 290 328 virtual void DrawBackground(wxDC& dc, wxWindow* wnd, const wxRect& rect) 291 329 { 330 #if wxCHECK_VERSION(2, 9, 0) 331 CFilterDC filter_dc(dc, 2, (m_tabCtrlHeight % 2) != 0, m_bottom); 332 wxAuiGenericTabArt::DrawBackground(*((wxDC*)&filter_dc), wnd, rect); 333 #else 292 334 CFilterDC filter_dc(dc, 2, (m_tab_ctrl_height % 2) != 0, m_bottom); 293 335 wxAuiDefaultTabArt::DrawBackground(*((wxDC*)&filter_dc), wnd, rect); 336 #endif 294 337 } 295 338 protected: 296 339 wxAuiNotebookEx* m_pNotebook; -
src/interface/commandqueue.cpp
old new void CCommandQueue::GrantExclusiveEngineRequest() 289 289 290 290 wxCommandEvent evt(fzEVT_GRANTEXCLUSIVEENGINEACCESS); 291 291 evt.SetId(m_requestId); 292 m_pMainFrame->GetQueue()-> AddPendingEvent(evt);292 m_pMainFrame->GetQueue()->GetEventHandler()->AddPendingEvent(evt); 293 293 } 294 294 295 295 CFileZillaEngine* CCommandQueue::GetEngineExclusive(int requestId) -
src/interface/filezilla.h
old new 72 72 #include <wx/toolbar.h> 73 73 #include <wx/treectrl.h> 74 74 #include <wx/xrc/xmlres.h> 75 #include <wx/xml/xml.h> 75 76 76 77 #endif -
src/interface/import.cpp
old new wxString CImportDialog::DecodeLegacyPassword(wxString pass) 146 146 return _T(""); 147 147 int number = (pass[i] - '0') * 100 + 148 148 (pass[i + 1] - '0') * 10 + 149 pass[i + 2] - '0';149 (pass[i + 2] - '0'); 150 150 wxChar c = number ^ key[(i / 3 + pos) % strlen(key)]; 151 151 output += c; 152 152 } -
src/interface/listctrlex.cpp
old new wxListCtrlEx::~wxListCtrlEx() 73 73 #ifndef __WXMSW__ 74 74 wxScrolledWindow* wxListCtrlEx::GetMainWindow() const 75 75 { 76 #if def __WXMAC__76 #if defined(__WXMAC__) && !wxCHECK_VERSION(2, 9, 0) 77 77 return (wxScrolledWindow*)m_genericImpl->m_mainWin; 78 78 #else 79 79 return (wxScrolledWindow*)m_mainWin; -
src/interface/netconfwizard.cpp
old new void CNetConfWizard::SendNextCommand() 777 777 wxString hexIP = ip; 778 778 for (unsigned int i = 0; i < hexIP.Length(); i++) 779 779 { 780 #if wxCHECK_VERSION(2, 9, 0) 781 char c; 782 hexIP.GetChar(i).GetAsChar(&c); 783 #else 780 784 wxChar& c = hexIP[i]; 785 #endif 781 786 if (c == '.') 782 787 c = '-'; 783 788 else -
src/interface/queue.cpp
old new void CQueueViewBase::DisplayNumberQueuedFiles() 1310 1310 } 1311 1311 else 1312 1312 { 1313 if (m_folderScanCount )1313 if (m_folderScanCount && m_fileCount > 0) 1314 1314 str.Printf(m_title + _T(" (0+)"), m_fileCount); 1315 1315 else 1316 1316 str = m_title; … … void CQueueViewBase::RefreshItem(const CQueueItem* pItem) 1442 1442 void CQueueViewBase::OnNavigationKey(wxNavigationKeyEvent& event) 1443 1443 { 1444 1444 event.SetEventObject(m_pQueue); 1445 #if wxCHECK_VERSION(2, 9, 0) 1446 m_pQueue->ProcessWindowEvent(event); 1447 #else 1445 1448 m_pQueue->ProcessEvent(event); 1449 #endif 1446 1450 } 1447 1451 1448 1452 void CQueueViewBase::OnChar(wxKeyEvent& event) -
src/interface/queue_storage.cpp
old new struct fast_equal 135 135 { 136 136 // wxString is CoW, yet it doesn't even do this fast pointer 137 137 // comparison in it's less and/or equal operator(s). 138 #if wxCHECK_VERSION(2, 9, 0) 139 return (const char*)lhs.c_str() == (const char*)rhs.c_str() || lhs == rhs; 140 #else 138 141 return lhs.c_str() == rhs.c_str() || lhs == rhs; 142 #endif 139 143 } 140 144 }; 141 145 … … bool CQueueStorage::Impl::Bind(sqlite3_stmt* statement, int index, wxLongLong_t 561 565 extern "C" { 562 566 static void custom_free(void* v) 563 567 { 564 #ifdef __WXMSW__ 568 #if defined(__WXMSW__) 569 #if !wxCHECK_VERSION(2, 9, 0) 565 570 wxStringData* data = reinterpret_cast<wxStringData*>(v) - 1; 566 571 data->Unlock(); 572 #endif 567 573 #else 568 574 char* s = reinterpret_cast<char*>(v); 569 575 delete [] s; … … static void custom_free(void* v) 574 580 bool CQueueStorage::Impl::Bind(sqlite3_stmt* statement, int index, const wxString& value) 575 581 { 576 582 #ifdef __WXMSW__ 583 #if wxCHECK_VERSION(2, 9, 0) 584 char* data = value.char_str(); 585 return sqlite3_bind_text16(statement, index, data, value.length(), custom_free) == SQLITE_OK; 586 #else 577 587 // Increase string reference and pass the data to sqlite with a custom deallocator that 578 588 // reduces the reference once sqlite is done with it. 579 589 wxStringData* data = reinterpret_cast<wxStringData*>(const_cast<wxChar*>(value.c_str())) - 1; 580 590 data->Lock(); 581 591 return sqlite3_bind_text16(statement, index, data + 1, data->nDataLength * 2, custom_free) == SQLITE_OK; 592 #endif 582 593 #else 583 594 char* out = new char[value.size() * 2]; 584 595 size_t outlen = utf16_.FromWChar(out, value.size() * 2, value.c_str(), value.size()); … … wxString CQueueStorage::Impl::GetColumnText(sqlite3_stmt* statement, int index, 831 842 int len = sqlite3_column_bytes16(statement, index); 832 843 if (text) 833 844 { 845 #if wxCHECK_VERSION(2, 9, 0) 846 wxStringBuffer* buffer = new wxStringBuffer(ret, len); 847 wxChar* out = *buffer; 848 #else 834 849 wxChar* out = ret.GetWriteBuf( len ); 850 #endif 835 851 int outlen = utf16_.ToWChar( out, len, text, len ); 852 #if wxCHECK_VERSION(2, 9, 0) 853 delete buffer; 854 #else 836 855 ret.UngetWriteBuf( outlen ); 856 #endif 837 857 if (shrink) 838 858 ret.Shrink(); 839 859 } -
src/interface/quickconnectbar.cpp
old new void CQuickconnectBar::OnKeyboardNavigation(wxNavigationKeyEvent& event) 222 222 if (event.GetDirection() && event.GetEventObject() == XRCCTRL(*this, "ID_QUICKCONNECT_DROPDOWN", wxButton)) 223 223 { 224 224 event.SetEventObject(this); 225 GetParent()-> ProcessEvent(event);225 GetParent()->GetEventHandler()->ProcessEvent(event); 226 226 } 227 227 else if (!event.GetDirection() && event.GetEventObject() == m_pHost) 228 228 { 229 229 event.SetEventObject(this); 230 GetParent()-> ProcessEvent(event);230 GetParent()->GetEventHandler()->ProcessEvent(event); 231 231 } 232 232 else 233 233 event.Skip(); -
src/interface/resources/xrc/settings.xrc
old new 427 427 </object> 428 428 <cols>1</cols> 429 429 <vgap>3</vgap> 430 <rows> 2</rows>430 <rows>3</rows> 431 431 </object> 432 432 <flag>wxLEFT|wxRIGHT|wxBOTTOM</flag> 433 433 <border>4</border> … … 632 632 <object class="sizeritem"> 633 633 <object class="wxListCtrl" name="ID_KEYS"> 634 634 <style>wxLC_REPORT|wxSUNKEN_BORDER</style> 635 <size>400,-1</size> 635 636 </object> 636 <option>1</option> 637 <flag>wxGROW</flag> 637 <flag>wxSHAPED</flag> 638 638 </object> 639 639 <vgap>5</vgap> 640 640 <growablecols>0</growablecols> … … 1393 1393 <object class="sizeritem"> 1394 1394 <object class="wxFlexGridSizer"> 1395 1395 <cols>2</cols> 1396 <rows> 2</rows>1396 <rows>3</rows> 1397 1397 <object class="sizeritem"> 1398 1398 <object class="wxStaticText"> 1399 1399 <label>&Theme:</label> … … 2105 2105 </object> 2106 2106 <growablecols>1</growablecols> 2107 2107 </object> 2108 <flag>wxGROW</flag>2109 2108 <minsize>400,0</minsize> 2110 2109 </object> 2111 2110 <growablecols>0</growablecols> -
src/interface/settings/optionspage_dateformatting.cpp
old new bool COptionsPageDateFormatting::LoadPage() 16 16 const wxString& dateFormat = m_pOptions->GetOption(OPTION_DATE_FORMAT); 17 17 if (dateFormat == _T("1")) 18 18 SetRCheck(XRCID("ID_DATEFORMAT_ISO"), true, failure); 19 else if ( dateFormat[0] == '2')19 else if (!dateFormat.IsEmpty() && dateFormat[0] == '2') 20 20 { 21 21 SetRCheck(XRCID("ID_DATEFORMAT_CUSTOM"), true, failure); 22 22 SetText(XRCID("ID_CUSTOM_DATEFORMAT"), dateFormat.Mid(1), failure); … … bool COptionsPageDateFormatting::LoadPage() 27 27 const wxString& timeFormat = m_pOptions->GetOption(OPTION_TIME_FORMAT); 28 28 if (timeFormat == _T("1")) 29 29 SetRCheck(XRCID("ID_TIMEFORMAT_ISO"), true, failure); 30 else if ( timeFormat[0] == '2')30 else if (!timeFormat.IsEmpty() && timeFormat[0] == '2') 31 31 { 32 32 SetRCheck(XRCID("ID_TIMEFORMAT_CUSTOM"), true, failure); 33 33 SetText(XRCID("ID_CUSTOM_TIMEFORMAT"), timeFormat.Mid(1), failure); -
src/interface/sitemanager.cpp
old new CSiteManagerItemData_Site* CSiteManager::GetSiteByPath(wxString sitePath) 525 525 526 526 bool CSiteManager::GetBookmarks(wxString sitePath, std::list<wxString> &bookmarks) 527 527 { 528 if (sitePath.IsEmpty()) 529 return false; 528 530 wxChar c = sitePath[0]; 529 531 if (c != '0' && c != '1') 530 532 return false; -
src/interface/statusbar.cpp
old new void wxStatusBarEx::OnSize(wxSizeEvent& event) 153 153 void wxStatusBarEx::SetStatusText(const wxString& text, int number /*=0*/) 154 154 { 155 155 // Basically identical to the wx one, but not calling Update 156 wxString oldText = m_statusStrings[number];156 wxString oldText = GetStatusText(number); 157 157 if (oldText != text) 158 158 { 159 m_statusStrings[number] = text;159 wxStatusBar::SetStatusText(text, number); 160 160 161 161 wxRect rect; 162 162 GetFieldRect(number, rect); -
src/interface/timeformatting.cpp
old new public: 23 23 24 24 if (dateFormat == _T("1")) 25 25 m_dateFormat = _T("%Y-%m-%d"); 26 else if ( dateFormat[0] == '2')26 else if (!dateFormat.IsEmpty() && dateFormat[0] == '2') 27 27 m_dateFormat = dateFormat.Mid(1); 28 28 else 29 29 m_dateFormat = _T("%x"); … … public: 33 33 34 34 if (timeFormat == _T("1")) 35 35 m_dateTimeFormat += _T("%H:%M"); 36 else if ( timeFormat[0] == '2')36 else if (!timeFormat.IsEmpty() && timeFormat[0] == '2') 37 37 m_dateTimeFormat += timeFormat.Mid(1); 38 38 else 39 39 m_dateTimeFormat += _T("%X"); -
src/interface/viewheader.cpp
old new class CComboBoxEx : public wxComboBox 24 24 { 25 25 public: 26 26 CComboBoxEx(CViewHeader* parent) 27 : wxComboBox(parent, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, wxArrayString(), wxCB_DROPDOWN | wxTE_PROCESS_ENTER | wxCB_SORT) 27 : wxComboBox(parent, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, wxArrayString(), wxCB_DROPDOWN | wxTE_PROCESS_ENTER 28 #if !defined(__WXMAC__) || !wxCHECK_VERSION(2, 9, 0) 29 | wxCB_SORT 30 #endif 31 ) 28 32 { 29 33 m_parent = parent; 30 34 } … … protected: 67 71 navEvent.SetDirection(!event.ShiftDown()); 68 72 navEvent.SetFromTab(true); 69 73 navEvent.ResumePropagation(1); 70 m_parent-> ProcessEvent(navEvent);74 m_parent->GetEventHandler()->ProcessEvent(navEvent); 71 75 } 72 76 73 77 void OnChar(wxKeyEvent& event) -
src/interface/wrapengine.cpp
old new bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe 232 232 bool containsURL = false; 233 233 for (int i = 0; i <= strLen; i++) 234 234 { 235 if (( text[i] == ':' && text[i + 1] == '/' && text[i + 2] == '/') || // absolute236 ( text[i] == '/' && (!i || text[i - 1] == ' '))) // relative235 if ((i < strLen - 2 && text[i] == ':' && text[i + 1] == '/' && text[i + 2] == '/') || // absolute 236 (i < strLen && text[i] == '/' && (!i || text[i - 1] == ' '))) // relative 237 237 { 238 238 url = true; 239 239 containsURL = true; 240 240 } 241 if ( text[i] != ' ' && text[i] != 0)241 if (i < strLen && text[i] != ' ') 242 242 { 243 243 // If url, wrap on slashes and ampersands, but not first slash of something:// 244 244 if (!url || 245 (( text[i] != '/' || text[i + 1] == '/') && (text[i] != '&' || text[i + 1] == '&') && text[i] != '?'))245 ((i < strLen - 1 && (text[i] != '/' || text[i + 1] == '/')) && (i < strLen - 1 && (text[i] != '&' || text[i + 1] == '&')) && text[i] != '?')) 246 246 continue; 247 247 } 248 248 249 249 wxString segment; 250 250 if (wrapAfter == -1) 251 251 { 252 if ( text[i] == '/' || text[i] == '?' || text[i] == '&')252 if (i < strLen && (text[i] == '/' || text[i] == '?' || text[i] == '&')) 253 253 segment = text.Mid(start, i - start + 1); 254 254 else 255 255 segment = text.Mid(start, i - start); … … bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe 257 257 } 258 258 else 259 259 { 260 if ( text[i] == '/' || text[i] == '?' || text[i] == '&')260 if (i < strLen && (text[i] == '/' || text[i] == '?' || text[i] == '&')) 261 261 segment = text.Mid(wrapAfter + 1, i - wrapAfter); 262 262 else 263 263 segment = text.Mid(wrapAfter + 1, i - wrapAfter - 1); … … bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe 272 272 if (wrappedText != _T("")) 273 273 wrappedText += _T("\n"); 274 274 wrappedText += text.Mid(start, wrapAfter - start); 275 if ( text[wrapAfter] != ' ' && text[wrapAfter] != '\0')275 if (wrapAfter < strLen && text[wrapAfter] != ' ' && text[wrapAfter] != '\0') 276 276 wrappedText += text[wrapAfter]; 277 277 278 278 if (width + spaceWidth >= (int)maxLength) … … bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe 302 302 if (wrappedText != _T("")) 303 303 wrappedText += _T("\n"); 304 304 wrappedText += text.Mid(start, i - start); 305 if ( text[i] != ' ' && text[i] != '\0')305 if (i < strLen && text[i] != ' ' && text[i] != '\0') 306 306 wrappedText += text[i]; 307 307 start = i + 1; 308 308 wrapAfter = -1; … … bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe 316 316 wrapAfter = i; 317 317 } 318 318 319 if ( text[i] == ' ')319 if (i < strLen && text[i] == ' ') 320 320 url = false; 321 321 } 322 322 if (start < strLen)