Ticket #35655: patch-wxWidgets-2.9.diff
File patch-wxWidgets-2.9.diff, 33.0 KB (added by mojca (Mojca Miklavec), 11 years ago) |
---|
-
configure
http://trac.filezilla-project.org/ticket/8272
old new PACKAGE_VERSION_MAJOR 692 692 WINDRESFLAGS 693 693 WINDRES 694 694 WX_CONFIG_WITH_ARGS 695 WX_VERSION_MICRO 696 WX_VERSION_MINOR 697 WX_VERSION_MAJOR 695 698 WX_RESCOMP 696 699 WX_VERSION 697 700 WX_LIBS_STATIC … … $as_echo_n "checking for wxWidgets version >= $min_wx_version... " >&6; } 15987 15990 $as_echo_n "checking for wxWidgets version >= $min_wx_version (--unicode=yes --universal=no)... " >&6; } 15988 15991 fi 15989 15992 15990 WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args --unicode=yes --universal=no aui,xrc,adv,core,xml,net,base"15993 WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args --unicode=yes --universal=no" 15991 15994 15992 15995 WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null` 15993 15996 wx_config_major_version=`echo $WX_VERSION | \ … … $as_echo_n "checking for wxWidgets version >= $min_wx_version (--unicode=yes --u 16026 16029 16027 16030 16028 16031 if test -n "$wx_ver_ok"; then 16029 16030 16032 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $WX_VERSION)" >&5 16031 16033 $as_echo "yes (version $WX_VERSION)" >&6; } 16032 WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs `16034 WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs aui,html,xrc,adv,core,xml,net,base` 16033 16035 16034 16036 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wxWidgets static library" >&5 16035 16037 $as_echo_n "checking for wxWidgets static library... " >&6; } 16036 WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs 2>/dev/null`16038 WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs aui,html,xrc,adv,core,xml,net,base 2>/dev/null` 16037 16039 if test "x$WX_LIBS_STATIC" = "x"; then 16038 16040 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 16039 16041 $as_echo "no" >&6; } … … $as_echo "yes" >&6; } 16076 16078 fi 16077 16079 16078 16080 if test "x$wx_has_cppflags" = x ; then 16079 WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags `16081 WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags aui,html,xrc,adv,core,xml,net,base` 16080 16082 WX_CPPFLAGS=$WX_CFLAGS 16081 16083 WX_CXXFLAGS=$WX_CFLAGS 16082 16084 16083 16085 WX_CFLAGS_ONLY=$WX_CFLAGS 16084 16086 WX_CXXFLAGS_ONLY=$WX_CFLAGS 16085 16087 else 16086 WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags `16087 WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags `16088 WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags `16088 WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags aui,html,xrc,adv,core,xml,net,base` 16089 WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags aui,html,xrc,adv,core,xml,net,base` 16090 WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags aui,html,xrc,adv,core,xml,net,base` 16089 16091 16090 16092 WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"` 16091 16093 WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"` … … $as_echo "no (version $WX_VERSION is not new enough)" >&6; } 16109 16111 WX_LIBS="" 16110 16112 WX_LIBS_STATIC="" 16111 16113 WX_RESCOMP="" 16112 : 16114 16115 if test ! -z "--unicode=yes --universal=no"; then 16116 16117 wx_error_message=" 16118 The configuration you asked for $PACKAGE_NAME requires a wxWidgets 16119 build with the following settings: 16120 --unicode=yes --universal=no 16121 but such build is not available. 16122 16123 To see the wxWidgets builds available on this system, please use 16124 'wx-config --list' command. To use the default build, returned by 16125 'wx-config --selected-config', use the options with their 'auto' 16126 default values." 16127 16128 fi 16129 16130 wx_error_message=" 16131 The requested wxWidgets build couldn't be found. 16132 $wx_error_message 16133 16134 If you still get this error, then check that 'wx-config' is 16135 in path, the directory where wxWidgets libraries are installed 16136 (returned by 'wx-config --libs' command) is in LD_LIBRARY_PATH 16137 or equivalent variable and wxWidgets version is $MIN_WX_VERSION or above." 16138 16139 as_fn_error $? "$wx_error_message" "$LINENO" 5 16113 16140 16114 16141 fi 16115 16142 else … … $as_echo "no (version $WX_VERSION is not new enough)" >&6; } 16135 16162 16136 16163 16137 16164 16165 WX_VERSION_MAJOR="$wx_config_major_version" 16166 WX_VERSION_MINOR="$wx_config_minor_version" 16167 WX_VERSION_MICRO="$wx_config_micro_version" 16168 16169 16170 16171 16138 16172 if test "$wxWin" != 1; then 16139 16173 as_fn_error $? " 16140 16174 wxWidgets must be installed on your system … … $as_echo "no (version $WX_VERSION is not new enough)" >&6; } 16150 16184 equivalent variable and wxWidgets version is $MIN_WX_VERSION or above. 16151 16185 " "$LINENO" 5 16152 16186 fi 16153 if test "$wx_config_major_version" -gt "2" || test "$wx_config_minor_version" -gt " 8"; then16154 as_fn_error $? "You need to use wxWidgets 2. 8.x to compile this program." "$LINENO" 516187 if test "$wx_config_major_version" -gt "2" || test "$wx_config_minor_version" -gt "9"; then 16188 as_fn_error $? "You need to use wxWidgets 2.9.x to compile this program." "$LINENO" 5 16155 16189 fi 16156 16190 16157 16191 # --universal=no doesn't work correctly, it still accepts universal builds. Reject it manually here. -
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 #endif 85 54 86 void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, ...) const 55 87 { 56 88 InitLogFile(); -
src/engine/logging_private.h
old new class CLogging 6 6 public: 7 7 CLogging(CFileZillaEnginePrivate *pEngine); 8 8 virtual ~CLogging(); 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 #endif 9 18 10 19 void LogMessage(MessageType nMessageType, const wxChar *msgFormat, ...) const; 11 20 void LogMessageRaw(MessageType nMessageType, const wxChar *msg) const; -
src/engine/misc.cpp
old new void MakeLowerAscii(wxString& str) 365 365 { 366 366 for (size_t i = 0; i < str.Len(); i++) 367 367 { 368 #if wxCHECK_VERSION(2, 9, 0) 369 char c; 370 str.GetChar(i).GetAsChar(&c); 371 if (c >= 'A' && c <= 'Z') 372 { 373 c += 32; 374 str.SetChar(i, wxUniChar(c)); 375 } 376 #else 368 377 wxChar& c = str[i]; 369 378 if (c >= 'A' && c <= 'Z') 370 379 c += 32; 380 #endif 371 381 } 372 382 } 373 383 -
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"), true }, 18 { HTTPS, _T("https"), true, 443, true, wxTRANSLATE("HTTPS - HTTP over TLS"), true },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"), true }, 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("") } 23 23 }; 24 24 -
src/engine/serverpath.cpp
old new wxString CServerPath::GetSafePath() const 276 276 len += iter->Length() + 2 + INTLENGTH; 277 277 278 278 wxString safepath; 279 #if wxCHECK_VERSION(2, 9, 0) 280 wxStringBuffer* buffer = new wxStringBuffer(safepath, len); 281 wxChar* t = *buffer; 282 #else 279 283 wxChar* start = safepath.GetWriteBuf(len); 280 284 wxChar* t = start; 285 #endif 281 286 282 287 t = fast_sprint_number(t, m_type); 283 288 *(t++) = ' '; … … wxString CServerPath::GetSafePath() const 299 304 t += iter->size(); 300 305 } 301 306 *t = 0; 302 307 #if !wxCHECK_VERSION(2, 9, 0) 303 308 safepath.UngetWriteBuf( t - start ); 309 #else 310 delete buffer; 311 #endif 304 312 safepath.Shrink(); 305 313 306 314 return safepath; -
src/engine/socket.cpp
old new void CSocket::SetEventHandler(CSocketEventHandler* pEvtHandler) 1273 1273 } 1274 1274 } 1275 1275 1276 #define ERRORDECL(c, desc) { c, _T(#c), wxTRANSLATE(desc) },1276 #define ERRORDECL(c, desc) { c, _T(#c), _T(desc) }, 1277 1277 1278 1278 struct Error_table 1279 1279 { -
src/engine/string_coalescer.cpp
old new struct fast_equal 66 66 { 67 67 // wxString is CoW, yet it doesn't even do this fast pointer 68 68 // comparison in it's less and/or equal operator(s). 69 #if wxCHECK_VERSION(2, 9, 0) 70 return lhs == rhs; 71 #else 69 72 return lhs.c_str() == rhs.c_str() || lhs == rhs; 73 #endif 70 74 } 71 75 }; 72 76 -
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() 265 265 COptions::Get()->SetOption(OPTION_LANGUAGE, _T("")); 266 266 } 267 267 #else 268 if ( !pInfo || !SetLocale(pInfo->Language))268 if (pInfo && !pInfo->Description.IsEmpty()) 269 269 { 270 if (pInfo && pInfo->Description )270 if (pInfo && pInfo->Description != "") 271 271 wxMessageBox(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); 272 272 else 273 273 wxMessageBox(wxString::Format(_("Failed to set language to %s, using default system language"), language.c_str()), _("Failed to change language"), wxICON_EXCLAMATION); … … void CFileZillaApp::CheckExistsFzsftp() 803 803 if (!found) 804 804 { 805 805 wxMessageBox(wxString::Format(_("%s could not be found. Without this component of FileZilla, SFTP will not work.\n\nPossible solutions:\n- Make sure %s is in a directory listed in your PATH environment variable.\n- Set the full path to %s in the FZ_FZSFTP environment variable."), program.c_str(), program.c_str(), program.c_str()), 806 _("File not found"), wxICON_ERROR );806 _("File not found"), wxICON_ERROR | wxOK); 807 807 executable.clear(); 808 808 } 809 809 #endif -
src/interface/Mainfrm.cpp
old new void CMainFrame::OnMenuHandler(wxCommandEvent &event) 754 754 // Do a crude approach: Drop everything unexpected... 755 755 for (unsigned int i = 0; i < version.Len(); i++) 756 756 { 757 #if wxCHECK_VERSION(2, 9, 0) 758 char c; 759 version.GetChar(i).GetAsChar(&c); 760 #else 757 761 wxChar& c = version[i]; 762 #endif 758 763 if ((version[i] >= '0' && version[i] <= '9') || 759 764 (version[i] >= 'a' && version[i] <= 'z') || 760 765 (version[i] >= 'A' && version[i] <= 'Z') || 761 766 version[i] == '-' || version[i] == '.' || 762 767 version[i] == '_') 763 768 { 764 url += c;769 url.Append(c); 765 770 } 766 771 } 767 772 } … … void CMainFrame::OnMenuHandler(wxCommandEvent &event) 779 784 { 780 785 pStatusBar->Show(show); 781 786 wxSizeEvent evt; 787 #if wxCHECK_VERSION(2, 9, 0) 788 controls->pLocalListViewPanel->ProcessWindowEvent(evt); 789 #else 782 790 controls->pLocalListViewPanel->ProcessEvent(evt); 791 #endif 783 792 } 784 793 } 785 794 if (controls && controls->pRemoteListViewPanel) … … void CMainFrame::OnMenuHandler(wxCommandEvent &event) 789 798 { 790 799 pStatusBar->Show(show); 791 800 wxSizeEvent evt; 801 #if wxCHECK_VERSION(2, 9, 0) 802 controls->pRemoteListViewPanel->ProcessWindowEvent(evt); 803 #else 792 804 controls->pRemoteListViewPanel->ProcessEvent(evt); 805 #endif 793 806 } 794 807 } 795 808 } -
src/interface/QueueView.cpp
old new wxString CQueueView::ReplaceInvalidCharacters(const wxString& filename) 3419 3419 const wxChar replace = COptions::Get()->GetOption(OPTION_INVALID_CHAR_REPLACE)[0]; 3420 3420 3421 3421 wxString result; 3422 3422 #if wxCHECK_VERSION(2, 9, 0) 3423 wxStringBuffer* buffer = new wxStringBuffer(result, filename.Len() + 1); 3424 wxChar* buf = *buffer; 3425 #else 3423 3426 wxChar* start = result.GetWriteBuf(filename.Len() + 1); 3424 3427 wxChar* buf = start; 3428 #endif 3425 3429 3426 3430 const wxChar* p = filename.c_str(); 3427 3431 while (*p) … … wxString CQueueView::ReplaceInvalidCharacters(const wxString& filename) 3456 3460 p++; 3457 3461 } 3458 3462 *buf = 0; 3459 3463 #if wxCHECK_VERSION(2, 9, 0) 3464 delete buffer; 3465 #else 3460 3466 result.UngetWriteBuf( buf - start ); 3461 3467 #endif 3462 3468 return result; 3463 3469 } 3464 3470 -
src/interface/RemoteTreeView.cpp
old new void CRemoteTreeView::SetDirectoryListing(const CSharedPointer<const CDirectoryL 350 350 SetItemImages(parent, false); 351 351 352 352 #ifndef __WXMSW__ 353 m_freezeCount--;353 Thaw(); 354 354 #endif 355 355 if (!modified) 356 356 SafeSelectItem(parent); -
src/interface/StatusView.cpp
old new public: 58 58 { 59 59 wxWindow* parent = GetParent(); 60 60 event.SetEventObject(parent); 61 parent-> ProcessEvent(event);61 parent->GetEventHandler()->ProcessEvent(event); 62 62 } 63 63 #else 64 64 void OnKeyDown(wxKeyEvent& event) … … public: 76 76 navEvent.SetDirection(!event.ShiftDown()); 77 77 navEvent.SetFromTab(true); 78 78 navEvent.ResumePropagation(1); 79 parent-> ProcessEvent(navEvent);79 parent->GetEventHandler()->ProcessEvent(navEvent); 80 80 } 81 81 #endif 82 82 }; -
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 71 71 #include <wx/toolbar.h> 72 72 #include <wx/treectrl.h> 73 73 #include <wx/xrc/xmlres.h> 74 #include <wx/xml/xml.h> 74 75 75 76 #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 #ifdef __WXMAC__ 76 #ifdef __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 544 548 extern "C" { 545 549 static void custom_free(void* v) 546 550 { 547 #ifdef __WXMSW__ 551 #if defined(__WXMSW__) 552 #if !wxCHECK_VERSION(2, 9, 0) 548 553 wxStringData* data = reinterpret_cast<wxStringData*>(v) - 1; 549 554 data->Unlock(); 555 #endif 550 556 #else 551 557 char* s = reinterpret_cast<char*>(v); 552 558 delete [] s; … … static void custom_free(void* v) 557 563 bool CQueueStorage::Impl::Bind(sqlite3_stmt* statement, int index, const wxString& value) 558 564 { 559 565 #ifdef __WXMSW__ 566 #if wxCHECK_VERSION(2, 9, 0) 567 char* data = value.char_str(); 568 return sqlite3_bind_text16(statement, index, data, value.length(), custom_free) == SQLITE_OK; 569 #else 560 570 // Increase string reference and pass the data to sqlite with a custom deallocator that 561 571 // reduces the reference once sqlite is done with it. 562 572 wxStringData* data = reinterpret_cast<wxStringData*>(const_cast<wxChar*>(value.c_str())) - 1; 563 573 data->Lock(); 564 574 return sqlite3_bind_text16(statement, index, data + 1, data->nDataLength * 2, custom_free) == SQLITE_OK; 575 #endif 565 576 #else 566 577 char* out = new char[value.size() * 2]; 567 578 size_t outlen = utf16_.FromWChar(out, value.size() * 2, value.c_str(), value.size()); … … wxString CQueueStorage::Impl::GetColumnText(sqlite3_stmt* statement, int index, 814 825 int len = sqlite3_column_bytes16(statement, index); 815 826 if (text) 816 827 { 828 #if wxCHECK_VERSION(2, 9, 0) 829 wxStringBuffer* buffer = new wxStringBuffer(ret, len); 830 wxChar* out = *buffer; 831 #else 817 832 wxChar* out = ret.GetWriteBuf( len ); 833 #endif 818 834 int outlen = utf16_.ToWChar( out, len, text, len ); 835 #if wxCHECK_VERSION(2, 9, 0) 836 delete buffer; 837 #else 819 838 ret.UngetWriteBuf( outlen ); 839 #endif 820 840 if (shrink) 821 841 ret.Shrink(); 822 842 } -
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/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> … … 1363 1363 <object class="sizeritem"> 1364 1364 <object class="wxFlexGridSizer"> 1365 1365 <cols>2</cols> 1366 <rows> 2</rows>1366 <rows>3</rows> 1367 1367 <object class="sizeritem"> 1368 1368 <object class="wxStaticText"> 1369 1369 <label>&Theme:</label> … … 2076 2076 </object> 2077 2077 <growablecols>1</growablecols> 2078 2078 </object> 2079 <flag>wxGROW</flag>2080 2079 <minsize>400,0</minsize> 2081 2080 </object> 2082 2081 <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) 516 516 517 517 bool CSiteManager::GetBookmarks(wxString sitePath, std::list<wxString> &bookmarks) 518 518 { 519 if (sitePath.IsEmpty()) 520 return false; 519 521 wxChar c = sitePath[0]; 520 522 if (c != '0' && c != '1') 521 523 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 protected: 67 67 navEvent.SetDirection(!event.ShiftDown()); 68 68 navEvent.SetFromTab(true); 69 69 navEvent.ResumePropagation(1); 70 m_parent-> ProcessEvent(navEvent);70 m_parent->GetEventHandler()->ProcessEvent(navEvent); 71 71 } 72 72 73 73 void OnChar(wxKeyEvent& event) -
src/interface/wrapengine.cpp
old new bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe 234 234 bool containsURL = false; 235 235 for (int i = 0; i <= strLen; i++) 236 236 { 237 if (( text[i] == ':' && text[i + 1] == '/' && text[i + 2] == '/') || // absolute238 ( text[i] == '/' && (!i || text[i - 1] == ' '))) // relative237 if ((i < strLen - 2 && text[i] == ':' && text[i + 1] == '/' && text[i + 2] == '/') || // absolute 238 (i < strLen && text[i] == '/' && (!i || text[i - 1] == ' '))) // relative 239 239 { 240 240 url = true; 241 241 containsURL = true; 242 242 } 243 if ( text[i] != ' ' && text[i] != 0)243 if (i < strLen && text[i] != ' ') 244 244 { 245 245 // If url, wrap on slashes and ampersands, but not first slash of something:// 246 246 if (!url || 247 (( text[i] != '/' || text[i + 1] == '/') && (text[i] != '&' || text[i + 1] == '&') && text[i] != '?'))247 ((i < strLen - 1 && (text[i] != '/' || text[i + 1] == '/')) && (i < strLen - 1 && (text[i] != '&' || text[i + 1] == '&')) && text[i] != '?')) 248 248 continue; 249 249 } 250 250 251 251 wxString segment; 252 252 if (wrapAfter == -1) 253 253 { 254 if ( text[i] == '/' || text[i] == '?' || text[i] == '&')254 if (i < strLen && (text[i] == '/' || text[i] == '?' || text[i] == '&')) 255 255 segment = text.Mid(start, i - start + 1); 256 256 else 257 257 segment = text.Mid(start, i - start); … … bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe 259 259 } 260 260 else 261 261 { 262 if ( text[i] == '/' || text[i] == '?' || text[i] == '&')262 if (i < strLen && (text[i] == '/' || text[i] == '?' || text[i] == '&')) 263 263 segment = text.Mid(wrapAfter + 1, i - wrapAfter); 264 264 else 265 265 segment = text.Mid(wrapAfter + 1, i - wrapAfter - 1); … … bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe 274 274 if (wrappedText != _T("")) 275 275 wrappedText += _T("\n"); 276 276 wrappedText += text.Mid(start, wrapAfter - start); 277 if ( text[wrapAfter] != ' ' && text[wrapAfter] != '\0')277 if (wrapAfter < strLen && text[wrapAfter] != ' ' && text[wrapAfter] != '\0') 278 278 wrappedText += text[wrapAfter]; 279 279 280 280 if (width + spaceWidth >= (int)maxLength) … … bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe 304 304 if (wrappedText != _T("")) 305 305 wrappedText += _T("\n"); 306 306 wrappedText += text.Mid(start, i - start); 307 if ( text[i] != ' ' && text[i] != '\0')307 if (i < strLen && text[i] != ' ' && text[i] != '\0') 308 308 wrappedText += text[i]; 309 309 start = i + 1; 310 310 wrapAfter = -1; … … bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe 318 318 wrapAfter = i; 319 319 } 320 320 321 if ( text[i] == ' ')321 if (i < strLen && text[i] == ' ') 322 322 url = false; 323 323 } 324 324 if (start < strLen)