Ticket #8272: filezilla.wx9.patch
File filezilla.wx9.patch, 29.7 KB (added by , 10 years ago) |
---|
-
configure.in
# Author Tautvydas Andrikys, esminis@esminis.lt wxWidgets 2.9 support diff -r 7340e508d364 -r 8fb092b8bf86 configure.in
a b 111 111 equivalent variable and wxWidgets version is $MIN_WX_VERSION or above. 112 112 ]) 113 113 fi 114 if test "$wx_config_major_version" -gt "2" || test "$wx_config_minor_version" -gt " 8"; then115 AC_MSG_ERROR([You need to use wxWidgets 2. 8.x to compile this program.])114 if test "$wx_config_major_version" -gt "2" || test "$wx_config_minor_version" -gt "9"; then 115 AC_MSG_ERROR([You need to use wxWidgets 2.9.x to compile this program.]) 116 116 fi 117 117 118 118 # --universal=no doesn't work correctly, it still accepts universal builds. Reject it manually here. -
src/dbus/session_manager.cpp
diff -r 7340e508d364 -r 8fb092b8bf86 src/dbus/session_manager.cpp
a b 296 296 wxCloseEvent evt(query ? wxEVT_QUERY_END_SESSION : wxEVT_END_SESSION); 297 297 evt.SetCanVeto(veto && *veto); 298 298 299 if (!pTop-> ProcessEvent(evt))299 if (!pTop->GetEventHandler()->ProcessEvent(evt)) 300 300 return false; 301 301 302 302 if (veto) -
src/engine/httpcontrolsocket.cpp
diff -r 7340e508d364 -r 8fb092b8bf86 src/engine/httpcontrolsocket.cpp
a b 460 460 if (pData->m_newLocation == _T("")) 461 461 { 462 462 if (m_pCurrentServer->GetProtocol() == HTTPS) 463 location = _T("https://") + m_pCurrentServer->FormatHost() + pData->remotePath.FormatFilename(pData->remoteFile).c_str();463 location = _T("https://") + wxString(m_pCurrentServer->FormatHost()) + wxString(pData->remotePath.FormatFilename(pData->remoteFile).c_str()); 464 464 else 465 location = _T("http://") + m_pCurrentServer->FormatHost() + pData->remotePath.FormatFilename(pData->remoteFile).c_str();465 location = _T("http://") + wxString(m_pCurrentServer->FormatHost()) + wxString(pData->remotePath.FormatFilename(pData->remoteFile).c_str()); 466 466 hostWithPort = wxString::Format(_T("%s:%d"), m_pCurrentServer->FormatHost(true).c_str(), m_pCurrentServer->GetPort()); 467 467 } 468 468 else -
src/engine/local_path.cpp
diff -r 7340e508d364 -r 8fb092b8bf86 src/engine/local_path.cpp
a b 48 48 49 49 wxChar* out; 50 50 wxChar* start; 51 wxStringBuffer* buffer = 0; 51 52 if (*in == '\\') 52 53 { 53 54 // possibly UNC … … 58 59 m_path.clear(); 59 60 return false; 60 61 } 61 62 start = m_path.GetWriteBuf(path.Len() + 2);62 buffer = new wxStringBuffer(m_path, path.Len() + 2); 63 start = *buffer; 63 64 out = start; 64 65 *out++ = '\\'; 65 66 *out++ = '\\'; … … 77 78 { 78 79 // not a valid UNC path 79 80 *start = 0; 80 m_path.UngetWriteBuf( 0 );81 delete buffer; 81 82 return false; 82 83 } 83 84 … … 87 88 { 88 89 // Regular path 89 90 90 start = m_path.GetWriteBuf(path.Len() + 2); 91 buffer = new wxStringBuffer(m_path, path.Len() + 2); 92 start = *buffer; 91 93 out = start; 92 94 *out++ = *in++; 93 95 94 96 if (*in++ != ':') 95 97 { 96 98 *start = 0; 97 m_path.UngetWriteBuf( 0 );99 delete buffer; 98 100 return false; 99 101 } 100 102 *out++ = ':'; 101 103 if (*in != '/' && *in != '\\' && *in) 102 104 { 103 105 *start = 0; 104 m_path.UngetWriteBuf( 0 );106 delete buffer; 105 107 return false; 106 108 } 107 109 *out++ = path_separator; … … 120 122 return false; 121 123 } 122 124 125 #if wxCHECK_VERSION(2, 9, 0) 126 wxStringBuffer* buffer = new wxStringBuffer(m_path, path.Len() + 2); 127 wxChar* out = *buffer; 128 #else 123 129 wxChar* start = m_path.GetWriteBuf(path.Len() + 2); 124 130 wxChar* out = start; 131 #endif 125 132 126 133 *out++ = '/'; 127 134 segments.push_back(out); … … 210 217 } 211 218 212 219 *out = 0; 213 220 #if !wxCHECK_VERSION(2, 9, 0) 214 221 m_path.UngetWriteBuf( out - start ); 222 #else 223 if (buffer != 0) { 224 delete buffer; 225 } 226 #endif 215 227 216 228 ::Coalesce(m_path); 217 229 -
src/engine/logging.cpp
diff -r 7340e508d364 -r 8fb092b8bf86 src/engine/logging.cpp
a b 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, wxCStrData value1) const 66 { 67 LogMessage(nMessageType, msgFormat, value1.AsWChar()); 68 } 69 70 void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2) const 71 { 72 LogMessage(nMessageType, msgFormat, value1.AsWChar(), value2.AsWChar()); 73 } 74 #endif 75 54 76 void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, ...) const 55 77 { 56 78 InitLogFile(); -
src/engine/logging_private.h
diff -r 7340e508d364 -r 8fb092b8bf86 src/engine/logging_private.h
a b 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, wxCStrData value1) const; 14 void LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2) const; 15 #endif 16 10 17 void LogMessage(MessageType nMessageType, const wxChar *msgFormat, ...) const; 11 18 void LogMessageRaw(MessageType nMessageType, const wxChar *msg) const; 12 19 void LogMessage(wxString sourceFile, int nSourceLine, void *pInstance, MessageType nMessageType, const wxChar *msgFormat, ...) const; -
src/engine/misc.cpp
diff -r 7340e508d364 -r 8fb092b8bf86 src/engine/misc.cpp
a b 363 363 { 364 364 for (size_t i = 0; i < str.Len(); i++) 365 365 { 366 #if wxCHECK_VERSION(2, 9, 0) 367 char c; 368 str.GetChar(i).GetAsChar(&c); 369 if (c >= 'A' && c <= 'Z') 370 { 371 c += 32; 372 str.SetChar(i, wxUniChar(c)); 373 } 374 #else 366 375 wxChar& c = str[i]; 367 376 if (c >= 'A' && c <= 'Z') 368 377 c += 32; 378 #endif 369 379 } 370 380 } 371 381 -
src/engine/proxy.cpp
diff -r 7340e508d364 -r 8fb092b8bf86 src/engine/proxy.cpp
a b 109 109 } 110 110 else 111 111 { 112 challenge = 0;112 challenge = (size_t)0; 113 113 challenge_len = 0; 114 114 } 115 115 -
src/engine/server.cpp
diff -r 7340e508d364 -r 8fb092b8bf86 src/engine/server.cpp
a b 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
diff -r 7340e508d364 -r 8fb092b8bf86 src/engine/serverpath.cpp
a b 278 278 len += iter->Length() + 2 + INTLENGTH; 279 279 280 280 wxString safepath; 281 #if wxCHECK_VERSION(2, 9, 0) 282 wxStringBuffer* buffer = new wxStringBuffer(safepath, len); 283 wxChar* t = *buffer; 284 #else 281 285 wxChar* start = safepath.GetWriteBuf(len); 282 286 wxChar* t = start; 287 #endif 283 288 284 289 t = fast_sprint_number(t, m_type); 285 290 *(t++) = ' '; … … 302 307 } 303 308 *t = 0; 304 309 310 #if !wxCHECK_VERSION(2, 9, 0) 305 311 safepath.UngetWriteBuf( t - start ); 312 #else 313 delete buffer; 314 #endif 315 306 316 safepath.Shrink(); 307 317 308 318 return safepath; -
src/engine/socket.cpp
diff -r 7340e508d364 -r 8fb092b8bf86 src/engine/socket.cpp
a b 1266 1266 } 1267 1267 } 1268 1268 1269 #define ERRORDECL(c, desc) { c, _T(#c), wxTRANSLATE(desc) },1269 #define ERRORDECL(c, desc) { c, _T(#c), _T(desc) }, 1270 1270 1271 1271 struct Error_table 1272 1272 { -
src/engine/string_coalescer.cpp
diff -r 7340e508d364 -r 8fb092b8bf86 src/engine/string_coalescer.cpp
a b 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
diff -r 7340e508d364 -r 8fb092b8bf86 src/include/libfilezilla.h
a b 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
diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/FileZilla.cpp
a b 263 263 #else 264 264 if (!pInfo || !SetLocale(pInfo->Language)) 265 265 { 266 if (pInfo && pInfo->Description)266 if (pInfo && !pInfo->Description.IsEmpty()) 267 267 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); 268 268 else 269 269 wxMessageBox(wxString::Format(_("Failed to set language to %s, using default system language"), language.c_str()), _("Failed to change language"), wxICON_EXCLAMATION); … … 793 793 if (!found) 794 794 { 795 795 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()), 796 _("File not found"), wxICON_ERROR );796 _("File not found"), wxICON_ERROR | wxOK); 797 797 executable.clear(); 798 798 } 799 799 #endif -
src/interface/Mainfrm.cpp
diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/Mainfrm.cpp
a b 744 744 // Do a crude approach: Drop everything unexpected... 745 745 for (unsigned int i = 0; i < version.Len(); i++) 746 746 { 747 #if wxCHECK_VERSION(2, 9, 0) 748 char c; 749 version.GetChar(i).GetAsChar(&c); 750 #else 747 751 wxChar& c = version[i]; 752 #endif 748 753 if ((version[i] >= '0' && version[i] <= '9') || 749 754 (version[i] >= 'a' && version[i] <= 'z') || 750 755 (version[i] >= 'A' && version[i] <= 'Z') || 751 756 version[i] == '-' || version[i] == '.' || 752 757 version[i] == '_') 753 758 { 754 url += c;759 url.Append(c); 755 760 } 756 761 } 757 762 } … … 769 774 { 770 775 pStatusBar->Show(show); 771 776 wxSizeEvent evt; 777 #if wxCHECK_VERSION(2, 9, 0) 778 controls->pLocalListViewPanel->ProcessWindowEvent(evt); 779 #else 772 780 controls->pLocalListViewPanel->ProcessEvent(evt); 781 #endif 773 782 } 774 783 } 775 784 if (controls && controls->pRemoteListViewPanel) … … 779 788 { 780 789 pStatusBar->Show(show); 781 790 wxSizeEvent evt; 791 #if wxCHECK_VERSION(2, 9, 0) 792 controls->pRemoteListViewPanel->ProcessWindowEvent(evt); 793 #else 782 794 controls->pRemoteListViewPanel->ProcessEvent(evt); 795 #endif 783 796 } 784 797 } 785 798 } -
src/interface/QueueView.cpp
diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/QueueView.cpp
a b 3446 3446 3447 3447 wxString result; 3448 3448 3449 #if wxCHECK_VERSION(2, 9, 0) 3450 wxStringBuffer* buffer = new wxStringBuffer(result, filename.Len() + 1); 3451 wxChar* buf = *buffer; 3452 #else 3449 3453 wxChar* start = result.GetWriteBuf(filename.Len() + 1); 3450 3454 wxChar* buf = start; 3455 #endif 3451 3456 3452 3457 const wxChar* p = filename.c_str(); 3453 3458 while (*p) … … 3482 3487 p++; 3483 3488 } 3484 3489 *buf = 0; 3485 3490 #if wxCHECK_VERSION(2, 9, 0) 3491 delete buffer; 3492 #else 3486 3493 result.UngetWriteBuf( buf - start ); 3487 3494 #endif 3488 3495 return result; 3489 3496 } 3490 3497 -
src/interface/RemoteTreeView.cpp
diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/RemoteTreeView.cpp
a b 348 348 SetItemImages(parent, false); 349 349 350 350 #ifndef __WXMSW__ 351 m_freezeCount--;351 Thaw(); 352 352 #endif 353 353 if (!modified) 354 354 SafeSelectItem(parent); -
src/interface/StatusView.cpp
diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/StatusView.cpp
a b 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) … … 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
diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/aui_notebook_ex.cpp
a b 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 … … 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; … … 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 … … 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 { 264 280 dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); … … 267 283 if (!m_fonts_initialized) 268 284 { 269 285 m_fonts_initialized = true; 286 #if wxCHECK_VERSION(2, 9, 0) 287 m_original_normal_font = m_normalFont; 288 m_highlighted_font = m_normalFont; 289 #else 270 290 m_original_normal_font = m_normal_font; 271 291 m_highlighted_font = m_normal_font; 292 #endif 272 293 m_highlighted_font.SetWeight(wxFONTWEIGHT_BOLD); 273 294 m_highlighted_font.SetStyle(wxFONTSTYLE_ITALIC); 274 295 } 296 #if wxCHECK_VERSION(2, 9, 0) 297 m_normalFont = m_highlighted_font; 298 #else 275 299 m_normal_font = m_highlighted_font; 300 #endif 276 301 } 277 302 else if (m_fonts_initialized) 303 #if wxCHECK_VERSION(2, 9, 0) 304 m_normalFont = m_original_normal_font; 305 #else 278 306 m_normal_font = m_original_normal_font; 307 #endif 279 308 } 280 309 310 #if wxCHECK_VERSION(2, 9, 0) 311 CFilterDC filter_dc(dc, pane.active ? 1 : 0, (m_tabCtrlHeight % 2) != 0, m_bottom); 312 wxAuiGenericTabArt::DrawTab(*((wxDC*)&filter_dc), wnd, pane, in_rect, close_button_state, out_tab_rect, out_button_rect, x_extent); 313 #else 281 314 CFilterDC filter_dc(dc, pane.active ? 1 : 0, (m_tab_ctrl_height % 2) != 0, m_bottom); 282 315 wxAuiDefaultTabArt::DrawTab(*((wxDC*)&filter_dc), wnd, pane, in_rect, close_button_state, out_tab_rect, out_button_rect, x_extent); 316 #endif 283 317 } 284 318 285 319 virtual void DrawBackground(wxDC& dc, wxWindow* wnd, const wxRect& rect) 286 320 { 321 #if wxCHECK_VERSION(2, 9, 0) 322 CFilterDC filter_dc(dc, 2, (m_tabCtrlHeight % 2) != 0, m_bottom); 323 wxAuiGenericTabArt::DrawBackground(*((wxDC*)&filter_dc), wnd, rect); 324 #else 287 325 CFilterDC filter_dc(dc, 2, (m_tab_ctrl_height % 2) != 0, m_bottom); 288 326 wxAuiDefaultTabArt::DrawBackground(*((wxDC*)&filter_dc), wnd, rect); 327 #endif 289 328 } 290 329 protected: 291 330 wxAuiNotebookEx* m_pNotebook; -
src/interface/commandqueue.cpp
diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/commandqueue.cpp
a b 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/import.cpp
diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/import.cpp
a b 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/netconfwizard.cpp
diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/netconfwizard.cpp
a b 771 771 wxString hexIP = ip; 772 772 for (unsigned int i = 0; i < hexIP.Length(); i++) 773 773 { 774 #if wxCHECK_VERSION(2, 9, 0) 775 char c; 776 hexIP.GetChar(i).GetAsChar(&c); 777 #else 774 778 wxChar& c = hexIP[i]; 779 #endif 775 780 if (c == '.') 776 781 c = '-'; 777 782 else -
src/interface/queue.cpp
diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/queue.cpp
a b 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; … … 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
diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/queue_storage.cpp
a b 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 … … 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; … … 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()); … … 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
diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/quickconnectbar.cpp
a b 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
diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/resources/settings.xrc
a b 428 428 </object> 429 429 <cols>1</cols> 430 430 <vgap>3</vgap> 431 <rows> 2</rows>431 <rows>3</rows> 432 432 </object> 433 433 <flag>wxLEFT|wxRIGHT|wxBOTTOM</flag> 434 434 <border>4</border> … … 633 633 <object class="sizeritem"> 634 634 <object class="wxListCtrl" name="ID_KEYS"> 635 635 <style>wxLC_REPORT|wxSUNKEN_BORDER</style> 636 <size>400,-1</size> 636 637 </object> 637 <option>1</option> 638 <flag>wxGROW</flag> 638 <flag>wxSHAPED</flag> 639 639 </object> 640 640 <vgap>5</vgap> 641 641 <growablecols>0</growablecols> … … 1364 1364 <object class="sizeritem"> 1365 1365 <object class="wxFlexGridSizer"> 1366 1366 <cols>2</cols> 1367 <rows> 2</rows>1367 <rows>3</rows> 1368 1368 <object class="sizeritem"> 1369 1369 <object class="wxStaticText"> 1370 1370 <label>&Theme:</label> … … 2079 2079 </object> 2080 2080 <growablecols>1</growablecols> 2081 2081 </object> 2082 <flag>wxGROW</flag>2083 2082 <minsize>400,0</minsize> 2084 2083 </object> 2085 2084 <growablecols>0</growablecols> -
src/interface/settings/optionspage_dateformatting.cpp
diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/settings/optionspage_dateformatting.cpp
a b 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); … … 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
diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/sitemanager.cpp
a b 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
diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/statusbar.cpp
a b 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
diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/timeformatting.cpp
a b 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"); … … 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
diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/viewheader.cpp
a b 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
diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/wrapengine.cpp
a b 233 233 bool url = false; 234 234 for (int i = 0; i <= strLen; i++) 235 235 { 236 if (( text[i] == ':' && text[i + 1] == '/' && text[i + 2] == '/') || // absolute237 ( text[i] == '/' && (!i || text[i - 1] == ' '))) // relative236 if ((i < strLen - 2 && text[i] == ':' && text[i + 1] == '/' && text[i + 2] == '/') || // absolute 237 (i < strLen && text[i] == '/' && (!i || text[i - 1] == ' '))) // relative 238 238 url = true; 239 if ( text[i] != ' ' && text[i] != 0)239 if (i < strLen && text[i] != ' ') 240 240 { 241 241 // If url, wrap on slashes and ampersands, but not first slash of something:// 242 242 if (!url || 243 (( text[i] != '/' || text[i + 1] == '/') && (text[i] != '&' || text[i + 1] == '&') && text[i] != '?'))243 ((i < strLen - 1 && (text[i] != '/' || text[i + 1] == '/')) && (i < strLen - 1 && (text[i] != '&' || text[i + 1] == '&')) && text[i] != '?')) 244 244 continue; 245 245 } 246 246 247 247 wxString segment; 248 248 if (wrapAfter == -1) 249 249 { 250 if ( text[i] == '/' || text[i] == '?' || text[i] == '&')250 if (i < strLen && (text[i] == '/' || text[i] == '?' || text[i] == '&')) 251 251 segment = text.Mid(start, i - start + 1); 252 252 else 253 253 segment = text.Mid(start, i - start); … … 255 255 } 256 256 else 257 257 { 258 if ( text[i] == '/' || text[i] == '?' || text[i] == '&')258 if (i < strLen && (text[i] == '/' || text[i] == '?' || text[i] == '&')) 259 259 segment = text.Mid(wrapAfter + 1, i - wrapAfter); 260 260 else 261 261 segment = text.Mid(wrapAfter + 1, i - wrapAfter - 1); … … 270 270 if (wrappedText != _T("")) 271 271 wrappedText += _T("\n"); 272 272 wrappedText += text.Mid(start, wrapAfter - start); 273 if ( text[wrapAfter] != ' ' && text[wrapAfter] != '\0')273 if (wrapAfter < strLen && text[wrapAfter] != ' ' && text[wrapAfter] != '\0') 274 274 wrappedText += text[wrapAfter]; 275 275 276 276 if (width + spaceWidth >= (int)maxLength) … … 300 300 if (wrappedText != _T("")) 301 301 wrappedText += _T("\n"); 302 302 wrappedText += text.Mid(start, i - start); 303 if ( text[i] != ' ' && text[i] != '\0')303 if (i < strLen && text[i] != ' ' && text[i] != '\0') 304 304 wrappedText += text[i]; 305 305 start = i + 1; 306 306 wrapAfter = -1; … … 314 314 wrapAfter = i; 315 315 } 316 316 317 if ( text[i] == ' ')317 if (i < strLen && text[i] == ' ') 318 318 url = false; 319 319 } 320 320 if (start < strLen)