Ticket #8272: filezilla.wx9.patch

File filezilla.wx9.patch, 29.7 KB (added by Tautvydas Andrikys, 12 years ago)

FileZilla wxWidgets 2.9 support

  • configure.in

    # Author Tautvydas Andrikys, esminis@esminis.lt
    wxWidgets 2.9 support
    
    diff -r 7340e508d364 -r 8fb092b8bf86 configure.in
    a b  
    111111        equivalent variable and wxWidgets version is $MIN_WX_VERSION or above.
    112112    ])
    113113  fi
    114   if test "$wx_config_major_version" -gt "2" || test "$wx_config_minor_version" -gt "8"; then
    115     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.])
    116116  fi
    117117
    118118  # --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  
    296296    wxCloseEvent evt(query ? wxEVT_QUERY_END_SESSION : wxEVT_END_SESSION);
    297297    evt.SetCanVeto(veto && *veto);
    298298
    299     if (!pTop->ProcessEvent(evt))
     299    if (!pTop->GetEventHandler()->ProcessEvent(evt))
    300300        return false;
    301301
    302302    if (veto)
  • src/engine/httpcontrolsocket.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/engine/httpcontrolsocket.cpp
    a b  
    460460    if (pData->m_newLocation == _T(""))
    461461    {
    462462        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());
    464464        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());
    466466        hostWithPort = wxString::Format(_T("%s:%d"), m_pCurrentServer->FormatHost(true).c_str(), m_pCurrentServer->GetPort());
    467467    }
    468468    else
  • src/engine/local_path.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/engine/local_path.cpp
    a b  
    4848
    4949    wxChar* out;
    5050    wxChar* start;
     51    wxStringBuffer* buffer = 0;
    5152    if (*in == '\\')
    5253    {
    5354        // possibly UNC
     
    5859            m_path.clear();
    5960            return false;
    6061        }
    61 
    62         start = m_path.GetWriteBuf(path.Len() + 2);
     62        buffer = new wxStringBuffer(m_path, path.Len() + 2);
     63        start = *buffer;
    6364        out = start;
    6465        *out++ = '\\';
    6566        *out++ = '\\';
     
    7778        {
    7879            // not a valid UNC path
    7980            *start = 0;
    80             m_path.UngetWriteBuf( 0 );
     81            delete buffer;
    8182            return false;
    8283        }
    8384
     
    8788    {
    8889        // Regular path
    8990
    90         start = m_path.GetWriteBuf(path.Len() + 2);
     91        buffer = new wxStringBuffer(m_path, path.Len() + 2);
     92        start = *buffer;
    9193        out = start;
    9294        *out++ = *in++;
    9395
    9496        if (*in++ != ':')
    9597        {
    9698            *start = 0;
    97             m_path.UngetWriteBuf( 0 );
     99            delete buffer;
    98100            return false;
    99101        }
    100102        *out++ = ':';
    101103        if (*in != '/' && *in != '\\' && *in)
    102104        {
    103105            *start = 0;
    104             m_path.UngetWriteBuf( 0 );
     106            delete buffer;
    105107            return false;
    106108        }
    107109        *out++ = path_separator;
     
    120122        return false;
    121123    }
    122124
     125#if wxCHECK_VERSION(2, 9, 0)
     126    wxStringBuffer* buffer = new wxStringBuffer(m_path, path.Len() + 2);
     127    wxChar* out = *buffer;
     128#else
    123129    wxChar* start = m_path.GetWriteBuf(path.Len() + 2);
    124130    wxChar* out = start;
     131#endif
    125132
    126133    *out++ = '/';
    127134    segments.push_back(out);
     
    210217    }
    211218
    212219    *out = 0;
    213 
     220#if !wxCHECK_VERSION(2, 9, 0)
    214221    m_path.UngetWriteBuf( out - start );
     222#else
     223    if (buffer != 0) {
     224        delete buffer;
     225    }
     226#endif
    215227
    216228    ::Coalesce(m_path);
    217229
  • src/engine/logging.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/engine/logging.cpp
    a b  
    5151    }
    5252}
    5353
     54#if wxCHECK_VERSION(2, 9, 0)
     55void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1) const
     56{
     57    LogMessage(nMessageType, msgFormat, (const char*)(wxString() << value1).c_str());
     58}
     59
     60void 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
     65void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1) const
     66{
     67    LogMessage(nMessageType, msgFormat, value1.AsWChar());
     68}
     69
     70void 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
    5476void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, ...) const
    5577{
    5678    InitLogFile();
  • src/engine/logging_private.h

    diff -r 7340e508d364 -r 8fb092b8bf86 src/engine/logging_private.h
    a b  
    77    CLogging(CFileZillaEnginePrivate *pEngine);
    88    virtual ~CLogging();
    99
     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   
    1017    void LogMessage(MessageType nMessageType, const wxChar *msgFormat, ...) const;
    1118    void LogMessageRaw(MessageType nMessageType, const wxChar *msg) const;
    1219    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  
    363363{
    364364    for (size_t i = 0; i < str.Len(); i++)
    365365    {
     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
    366375        wxChar& c = str[i];
    367376        if (c >= 'A' && c <= 'Z')
    368377            c += 32;
     378#endif
    369379    }
    370380}
    371381
  • src/engine/proxy.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/engine/proxy.cpp
    a b  
    109109        }
    110110        else
    111111        {
    112             challenge = 0;
     112            challenge = (size_t)0;
    113113            challenge_len = 0;
    114114        }
    115115
  • src/engine/server.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/engine/server.cpp
    a b  
    1212};
    1313
    1414static 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  },
    1616    { SFTP,         _T("sftp"),   true,  22,  false, _T("SFTP - SSH File Transfer Protocol"),                              false },
    1717    { 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  },
    2222    { UNKNOWN,      _T(""),       false, 21,  false, _T("") }
    2323};
    2424
  • src/engine/serverpath.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/engine/serverpath.cpp
    a b  
    278278        len += iter->Length() + 2 + INTLENGTH;
    279279
    280280    wxString safepath;
     281#if wxCHECK_VERSION(2, 9, 0)
     282    wxStringBuffer* buffer = new wxStringBuffer(safepath, len);
     283    wxChar* t = *buffer;
     284#else
    281285    wxChar* start = safepath.GetWriteBuf(len);
    282286    wxChar* t = start;
     287#endif
    283288
    284289    t = fast_sprint_number(t, m_type);
    285290    *(t++) = ' ';
     
    302307    }
    303308    *t = 0;
    304309
     310#if !wxCHECK_VERSION(2, 9, 0)
    305311    safepath.UngetWriteBuf( t - start );
     312#else
     313    delete buffer;
     314#endif
     315   
    306316    safepath.Shrink();
    307317
    308318    return safepath;
  • src/engine/socket.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/engine/socket.cpp
    a b  
    12661266    }
    12671267}
    12681268
    1269 #define ERRORDECL(c, desc) { c, _T(#c), wxTRANSLATE(desc) },
     1269#define ERRORDECL(c, desc) { c, _T(#c), _T(desc) },
    12701270
    12711271struct Error_table
    12721272{
  • src/engine/string_coalescer.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/engine/string_coalescer.cpp
    a b  
    6666    {
    6767        // wxString is CoW, yet it doesn't even do this fast pointer
    6868        // comparison in it's less and/or equal operator(s).
     69#if wxCHECK_VERSION(2, 9, 0)
     70        return lhs == rhs;
     71#else
    6972        return lhs.c_str() == rhs.c_str() || lhs == rhs;
     73#endif
    7074    }
    7175};
    7276
  • src/include/libfilezilla.h

    diff -r 7340e508d364 -r 8fb092b8bf86 src/include/libfilezilla.h
    a b  
    2121#include <wx/datetime.h>
    2222#include <wx/event.h>
    2323#include <wx/string.h>
     24#if wxCHECK_VERSION(2, 9, 0)
     25#include <wx/translation.h>
     26#include <wx/dcclient.h>
     27#endif
    2428
    2529#include <list>
    2630#include <vector>
  • src/interface/FileZilla.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/FileZilla.cpp
    a b  
    263263#else
    264264        if (!pInfo || !SetLocale(pInfo->Language))
    265265        {
    266             if (pInfo && pInfo->Description)
     266            if (pInfo && !pInfo->Description.IsEmpty())
    267267                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);
    268268            else
    269269                wxMessageBox(wxString::Format(_("Failed to set language to %s, using default system language"), language.c_str()), _("Failed to change language"), wxICON_EXCLAMATION);
     
    793793    if (!found)
    794794    {
    795795        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);
    797797        executable.clear();
    798798    }
    799799#endif
  • src/interface/Mainfrm.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/Mainfrm.cpp
    a b  
    744744            // Do a crude approach: Drop everything unexpected...
    745745            for (unsigned int i = 0; i < version.Len(); i++)
    746746            {
     747#if wxCHECK_VERSION(2, 9, 0)
     748                char c;
     749                version.GetChar(i).GetAsChar(&c);
     750#else
    747751                wxChar& c = version[i];
     752#endif
    748753                if ((version[i] >= '0' && version[i] <= '9') ||
    749754                    (version[i] >= 'a' && version[i] <= 'z') ||
    750755                    (version[i] >= 'A' && version[i] <= 'Z') ||
    751756                    version[i] == '-' || version[i] == '.' ||
    752757                    version[i] == '_')
    753758                {
    754                     url += c;
     759                    url.Append(c);
    755760                }
    756761            }
    757762        }
     
    769774            {
    770775                pStatusBar->Show(show);
    771776                wxSizeEvent evt;
     777#if wxCHECK_VERSION(2, 9, 0)
     778                controls->pLocalListViewPanel->ProcessWindowEvent(evt);
     779#else
    772780                controls->pLocalListViewPanel->ProcessEvent(evt);
     781#endif
    773782            }
    774783        }
    775784        if (controls && controls->pRemoteListViewPanel)
     
    779788            {
    780789                pStatusBar->Show(show);
    781790                wxSizeEvent evt;
     791#if wxCHECK_VERSION(2, 9, 0)
     792                controls->pRemoteListViewPanel->ProcessWindowEvent(evt);
     793#else
    782794                controls->pRemoteListViewPanel->ProcessEvent(evt);
     795#endif
    783796            }
    784797        }
    785798    }
  • src/interface/QueueView.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/QueueView.cpp
    a b  
    34463446
    34473447    wxString result;
    34483448
     3449#if wxCHECK_VERSION(2, 9, 0)
     3450    wxStringBuffer* buffer = new wxStringBuffer(result, filename.Len() + 1);
     3451    wxChar* buf = *buffer;
     3452#else
    34493453    wxChar* start = result.GetWriteBuf(filename.Len() + 1);
    34503454    wxChar* buf = start;
     3455#endif 
    34513456
    34523457    const wxChar* p = filename.c_str();
    34533458    while (*p)
     
    34823487        p++;
    34833488    }
    34843489    *buf = 0;
    3485 
     3490#if wxCHECK_VERSION(2, 9, 0)
     3491    delete buffer;
     3492#else   
    34863493    result.UngetWriteBuf( buf - start );
    3487 
     3494#endif
    34883495    return result;
    34893496}
    34903497
  • src/interface/RemoteTreeView.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/RemoteTreeView.cpp
    a b  
    348348    SetItemImages(parent, false);
    349349
    350350#ifndef __WXMSW__
    351     m_freezeCount--;
     351    Thaw();
    352352#endif
    353353    if (!modified)
    354354        SafeSelectItem(parent);
  • src/interface/StatusView.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/StatusView.cpp
    a b  
    5858    {
    5959        wxWindow* parent = GetParent();
    6060        event.SetEventObject(parent);
    61         parent->ProcessEvent(event);
     61        parent->GetEventHandler()->ProcessEvent(event);
    6262    }
    6363#else
    6464    void OnKeyDown(wxKeyEvent& event)
     
    7676        navEvent.SetDirection(!event.ShiftDown());
    7777        navEvent.SetFromTab(true);
    7878        navEvent.ResumePropagation(1);
    79         parent->ProcessEvent(navEvent);
     79        parent->GetEventHandler()->ProcessEvent(navEvent);
    8080    }
    8181#endif
    8282};
  • src/interface/aui_notebook_ex.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/aui_notebook_ex.cpp
    a b  
    33#include "aui_notebook_ex.h"
    44#include <wx/dcmirror.h>
    55
     6#if wxCHECK_VERSION(2, 9, 0)
     7wxColor wxAuiStepColour(const wxColor& c, int ialpha)
     8{   
     9    wxColor* result = new wxColor(c);
     10    result->ChangeLightness(ialpha);
     11    return *result;
     12}
     13#else
    614wxColor wxAuiStepColour(const wxColor& c, int ialpha);
     15#endif
    716
    817#ifdef __WXMSW__
    918#define TABCOLOUR wxSYS_COLOUR_3DFACE
     
    184193        }
    185194    }
    186195
    187 #ifdef __WXGTK__
    188     virtual GdkWindow* GetGDKWindow() const { return m_original_dc->GetGDKWindow(); }
    189 #endif
    190196protected:
    191197    int m_gradient_called;
    192198    int m_rectangle_called;
     
    215221    virtual wxAuiTabArt* Clone()
    216222    {
    217223        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
    218229        art->SetNormalFont(m_normal_font);
    219230        art->SetSelectedFont(m_selected_font);
    220231        art->SetMeasuringFont(m_measuring_font);
     232#endif
    221233        return art;
    222234    }
    223235
     
    257269                         int* x_extent)
    258270    {
    259271#ifndef __WXMAC__
     272#if wxCHECK_VERSION(2, 9, 0)
     273        m_baseColour = wxSystemSettings::GetColour(TABCOLOUR);
     274#else
    260275        m_base_colour = wxSystemSettings::GetColour(TABCOLOUR);
    261276#endif
     277#endif
    262278        if (!pane.active)
    263279        {
    264280            dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
     
    267283                if (!m_fonts_initialized)
    268284                {
    269285                    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
    270290                    m_original_normal_font = m_normal_font;
    271291                    m_highlighted_font = m_normal_font;
     292#endif
    272293                    m_highlighted_font.SetWeight(wxFONTWEIGHT_BOLD);
    273294                    m_highlighted_font.SetStyle(wxFONTSTYLE_ITALIC);
    274295                }
     296#if wxCHECK_VERSION(2, 9, 0)
     297                m_normalFont = m_highlighted_font;
     298#else
    275299                m_normal_font = m_highlighted_font;
     300#endif
    276301            }
    277302            else if (m_fonts_initialized)
     303#if wxCHECK_VERSION(2, 9, 0)
     304                m_normalFont = m_original_normal_font;
     305#else
    278306                m_normal_font = m_original_normal_font;
     307#endif
    279308        }
    280309
     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
    281314        CFilterDC filter_dc(dc, pane.active ? 1 : 0, (m_tab_ctrl_height % 2) != 0, m_bottom);
    282315        wxAuiDefaultTabArt::DrawTab(*((wxDC*)&filter_dc), wnd, pane, in_rect, close_button_state, out_tab_rect, out_button_rect, x_extent);
     316#endif
    283317    }
    284318
    285319    virtual void DrawBackground(wxDC& dc, wxWindow* wnd, const wxRect& rect)
    286320    {
     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
    287325        CFilterDC filter_dc(dc, 2, (m_tab_ctrl_height % 2) != 0, m_bottom);
    288326        wxAuiDefaultTabArt::DrawBackground(*((wxDC*)&filter_dc), wnd, rect);
     327#endif
    289328    }
    290329protected:
    291330    wxAuiNotebookEx* m_pNotebook;
  • src/interface/commandqueue.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/commandqueue.cpp
    a b  
    289289
    290290    wxCommandEvent evt(fzEVT_GRANTEXCLUSIVEENGINEACCESS);
    291291    evt.SetId(m_requestId);
    292     m_pMainFrame->GetQueue()->AddPendingEvent(evt);
     292    m_pMainFrame->GetQueue()->GetEventHandler()->AddPendingEvent(evt);
    293293}
    294294
    295295CFileZillaEngine* CCommandQueue::GetEngineExclusive(int requestId)
  • src/interface/import.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/import.cpp
    a b  
    146146            return _T("");
    147147        int number = (pass[i] - '0') * 100 +
    148148                        (pass[i + 1] - '0') * 10 +
    149                         pass[i + 2] - '0';
     149                        (pass[i + 2] - '0');
    150150        wxChar c = number ^ key[(i / 3 + pos) % strlen(key)];
    151151        output += c;
    152152    }
  • src/interface/netconfwizard.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/netconfwizard.cpp
    a b  
    771771            wxString hexIP = ip;
    772772            for (unsigned int i = 0; i < hexIP.Length(); i++)
    773773            {
     774#if wxCHECK_VERSION(2, 9, 0)
     775                char c;
     776                hexIP.GetChar(i).GetAsChar(&c);
     777#else
    774778                wxChar& c = hexIP[i];
     779#endif
    775780                if (c == '.')
    776781                    c = '-';
    777782                else
  • src/interface/queue.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/queue.cpp
    a b  
    13101310    }
    13111311    else
    13121312    {
    1313         if (m_folderScanCount)
     1313        if (m_folderScanCount && m_fileCount > 0)
    13141314            str.Printf(m_title + _T(" (0+)"), m_fileCount);
    13151315        else
    13161316            str = m_title;
     
    14421442void CQueueViewBase::OnNavigationKey(wxNavigationKeyEvent& event)
    14431443{
    14441444    event.SetEventObject(m_pQueue);
     1445#if wxCHECK_VERSION(2, 9, 0)
     1446    m_pQueue->ProcessWindowEvent(event);
     1447#else
    14451448    m_pQueue->ProcessEvent(event);
     1449#endif
    14461450}
    14471451
    14481452void CQueueViewBase::OnChar(wxKeyEvent& event)
  • src/interface/queue_storage.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/queue_storage.cpp
    a b  
    135135    {
    136136        // wxString is CoW, yet it doesn't even do this fast pointer
    137137        // 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
    138141        return lhs.c_str() == rhs.c_str() || lhs == rhs;
     142#endif
    139143    }
    140144};
    141145
     
    544548extern "C" {
    545549static void custom_free(void* v)
    546550{
    547 #ifdef __WXMSW__
     551#if defined(__WXMSW__)
     552#if !wxCHECK_VERSION(2, 9, 0)
    548553    wxStringData* data = reinterpret_cast<wxStringData*>(v) - 1;
    549554    data->Unlock();
     555#endif
    550556#else
    551557    char* s = reinterpret_cast<char*>(v);
    552558    delete [] s;
     
    557563bool CQueueStorage::Impl::Bind(sqlite3_stmt* statement, int index, const wxString& value)
    558564{
    559565#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
    560570    // Increase string reference and pass the data to sqlite with a custom deallocator that
    561571    // reduces the reference once sqlite is done with it.
    562572    wxStringData* data = reinterpret_cast<wxStringData*>(const_cast<wxChar*>(value.c_str())) - 1;
    563573    data->Lock();
    564574    return sqlite3_bind_text16(statement, index, data + 1, data->nDataLength * 2, custom_free) == SQLITE_OK;
     575#endif
    565576#else
    566577    char* out = new char[value.size() * 2];
    567578    size_t outlen = utf16_.FromWChar(out, value.size() * 2, value.c_str(), value.size());
     
    814825    int len = sqlite3_column_bytes16(statement, index);
    815826    if (text)
    816827    {
     828#if wxCHECK_VERSION(2, 9, 0)
     829        wxStringBuffer* buffer = new wxStringBuffer(ret, len);
     830        wxChar* out = *buffer;
     831#else
    817832        wxChar* out = ret.GetWriteBuf( len );
     833#endif
    818834        int outlen = utf16_.ToWChar( out, len, text, len );
     835#if wxCHECK_VERSION(2, 9, 0)
     836        delete buffer;
     837#else
    819838        ret.UngetWriteBuf( outlen );
     839#endif
    820840        if (shrink)
    821841            ret.Shrink();
    822842    }
  • src/interface/quickconnectbar.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/quickconnectbar.cpp
    a b  
    222222    if (event.GetDirection() && event.GetEventObject() == XRCCTRL(*this, "ID_QUICKCONNECT_DROPDOWN", wxButton))
    223223    {
    224224        event.SetEventObject(this);
    225         GetParent()->ProcessEvent(event);
     225        GetParent()->GetEventHandler()->ProcessEvent(event);
    226226    }
    227227    else if (!event.GetDirection() && event.GetEventObject() == m_pHost)
    228228    {
    229229        event.SetEventObject(this);
    230         GetParent()->ProcessEvent(event);
     230        GetParent()->GetEventHandler()->ProcessEvent(event);
    231231    }
    232232    else
    233233        event.Skip();
  • src/interface/resources/settings.xrc

    diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/resources/settings.xrc
    a b  
    428428              </object>
    429429              <cols>1</cols>
    430430              <vgap>3</vgap>
    431               <rows>2</rows>
     431              <rows>3</rows>
    432432            </object>
    433433            <flag>wxLEFT|wxRIGHT|wxBOTTOM</flag>
    434434            <border>4</border>
     
    633633              <object class="sizeritem">
    634634                <object class="wxListCtrl" name="ID_KEYS">
    635635                  <style>wxLC_REPORT|wxSUNKEN_BORDER</style>
     636                  <size>400,-1</size>
    636637                </object>
    637                 <option>1</option>
    638                 <flag>wxGROW</flag>
     638                <flag>wxSHAPED</flag>
    639639              </object>
    640640              <vgap>5</vgap>
    641641              <growablecols>0</growablecols>
     
    13641364          <object class="sizeritem">
    13651365            <object class="wxFlexGridSizer">
    13661366              <cols>2</cols>
    1367               <rows>2</rows>
     1367              <rows>3</rows>
    13681368              <object class="sizeritem">
    13691369                <object class="wxStaticText">
    13701370                  <label>&amp;Theme:</label>
     
    20792079                  </object>
    20802080                  <growablecols>1</growablecols>
    20812081                </object>
    2082                 <flag>wxGROW</flag>
    20832082                <minsize>400,0</minsize>
    20842083              </object>
    20852084              <growablecols>0</growablecols>
  • src/interface/settings/optionspage_dateformatting.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/settings/optionspage_dateformatting.cpp
    a b  
    1616    const wxString& dateFormat = m_pOptions->GetOption(OPTION_DATE_FORMAT);
    1717    if (dateFormat == _T("1"))
    1818        SetRCheck(XRCID("ID_DATEFORMAT_ISO"), true, failure);
    19     else if (dateFormat[0] == '2')
     19    else if (!dateFormat.IsEmpty() && dateFormat[0] == '2')
    2020    {
    2121        SetRCheck(XRCID("ID_DATEFORMAT_CUSTOM"), true, failure);
    2222        SetText(XRCID("ID_CUSTOM_DATEFORMAT"), dateFormat.Mid(1), failure);
     
    2727    const wxString& timeFormat = m_pOptions->GetOption(OPTION_TIME_FORMAT);
    2828    if (timeFormat == _T("1"))
    2929        SetRCheck(XRCID("ID_TIMEFORMAT_ISO"), true, failure);
    30     else if (timeFormat[0] == '2')
     30    else if (!timeFormat.IsEmpty() && timeFormat[0] == '2')
    3131    {
    3232        SetRCheck(XRCID("ID_TIMEFORMAT_CUSTOM"), true, failure);
    3333        SetText(XRCID("ID_CUSTOM_TIMEFORMAT"), timeFormat.Mid(1), failure);
  • src/interface/sitemanager.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/sitemanager.cpp
    a b  
    516516
    517517bool CSiteManager::GetBookmarks(wxString sitePath, std::list<wxString> &bookmarks)
    518518{
     519    if (sitePath.IsEmpty())
     520        return false;
    519521    wxChar c = sitePath[0];
    520522    if (c != '0' && c != '1')
    521523        return false;
  • src/interface/statusbar.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/statusbar.cpp
    a b  
    153153void wxStatusBarEx::SetStatusText(const wxString& text, int number /*=0*/)
    154154{
    155155    // Basically identical to the wx one, but not calling Update
    156     wxString oldText = m_statusStrings[number];
     156    wxString oldText = GetStatusText(number);
    157157    if (oldText != text)
    158158    {
    159         m_statusStrings[number] = text;
     159        wxStatusBar::SetStatusText(text, number);
    160160
    161161        wxRect rect;
    162162        GetFieldRect(number, rect);
  • src/interface/timeformatting.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/timeformatting.cpp
    a b  
    2323
    2424        if (dateFormat == _T("1"))
    2525            m_dateFormat = _T("%Y-%m-%d");
    26         else if (dateFormat[0] == '2')
     26        else if (!dateFormat.IsEmpty() && dateFormat[0] == '2')
    2727            m_dateFormat = dateFormat.Mid(1);
    2828        else
    2929            m_dateFormat = _T("%x");
     
    3333
    3434        if (timeFormat == _T("1"))
    3535            m_dateTimeFormat += _T("%H:%M");
    36         else if (timeFormat[0] == '2')
     36        else if (!timeFormat.IsEmpty() && timeFormat[0] == '2')
    3737            m_dateTimeFormat += timeFormat.Mid(1);
    3838        else
    3939            m_dateTimeFormat += _T("%X");
  • src/interface/viewheader.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/viewheader.cpp
    a b  
    6767        navEvent.SetDirection(!event.ShiftDown());
    6868        navEvent.SetFromTab(true);
    6969        navEvent.ResumePropagation(1);
    70         m_parent->ProcessEvent(navEvent);
     70        m_parent->GetEventHandler()->ProcessEvent(navEvent);
    7171    }
    7272
    7373    void OnChar(wxKeyEvent& event)
  • src/interface/wrapengine.cpp

    diff -r 7340e508d364 -r 8fb092b8bf86 src/interface/wrapengine.cpp
    a b  
    233233    bool url = false;
    234234    for (int i = 0; i <= strLen; i++)
    235235    {
    236         if ((text[i] == ':' && text[i + 1] == '/' && text[i + 2] == '/') || // absolute
    237             (text[i] == '/' && (!i || text[i - 1] == ' '))) // relative
     236        if ((i < strLen - 2 && text[i] == ':' && text[i + 1] == '/' && text[i + 2] == '/') || // absolute
     237            (i < strLen && text[i] == '/' && (!i || text[i - 1] == ' '))) // relative
    238238            url = true;
    239         if (text[i] != ' ' && text[i] != 0)
     239        if (i < strLen && text[i] != ' ')
    240240        {
    241241            // If url, wrap on slashes and ampersands, but not first slash of something://
    242242            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] != '?'))
    244244            continue;
    245245        }
    246246
    247247        wxString segment;
    248248        if (wrapAfter == -1)
    249249        {
    250             if (text[i] == '/' || text[i] == '?' || text[i] == '&')
     250            if (i < strLen && (text[i] == '/' || text[i] == '?' || text[i] == '&'))
    251251                segment = text.Mid(start, i - start + 1);
    252252            else
    253253                segment = text.Mid(start, i - start);
     
    255255        }
    256256        else
    257257        {
    258             if (text[i] == '/' || text[i] == '?' || text[i] == '&')
     258            if (i < strLen && (text[i] == '/' || text[i] == '?' || text[i] == '&'))
    259259                segment = text.Mid(wrapAfter + 1, i - wrapAfter);
    260260            else
    261261                segment = text.Mid(wrapAfter + 1, i - wrapAfter - 1);
     
    270270            if (wrappedText != _T(""))
    271271                wrappedText += _T("\n");
    272272            wrappedText += text.Mid(start, wrapAfter - start);
    273             if (text[wrapAfter] != ' ' && text[wrapAfter] != '\0')
     273            if (wrapAfter < strLen && text[wrapAfter] != ' ' && text[wrapAfter] != '\0')
    274274                wrappedText += text[wrapAfter];
    275275
    276276            if (width + spaceWidth >= (int)maxLength)
     
    300300            if (wrappedText != _T(""))
    301301                wrappedText += _T("\n");
    302302            wrappedText += text.Mid(start, i - start);
    303             if (text[i] != ' ' && text[i] != '\0')
     303            if (i < strLen && text[i] != ' ' && text[i] != '\0')
    304304                wrappedText += text[i];
    305305            start = i + 1;
    306306            wrapAfter = -1;
     
    314314            wrapAfter = i;
    315315        }
    316316
    317         if (text[i] == ' ')
     317        if (i < strLen && text[i] == ' ')
    318318            url = false;
    319319    }
    320320    if (start < strLen)