Ticket #8272: filezilla-3.7.4_wxWidgets-3.0.diff

File filezilla-3.7.4_wxWidgets-3.0.diff, 33.5 KB (added by Mojca Miklavec, 10 years ago)

A patch for FileZilla 3.7.4 (based on esminis' patch, but without the patch for configure.in)

  • configure

    http://trac.filezilla-project.org/ticket/8272
    http://trac.macports.org/browser/trunk/dports/www/FileZilla/files/patch-wxWidgets-3.0.diff
    
    old new PACKAGE_VERSION_MAJOR  
    692692WINDRESFLAGS
    693693WINDRES
    694694WX_CONFIG_WITH_ARGS
     695WX_VERSION_MICRO
     696WX_VERSION_MINOR
     697WX_VERSION_MAJOR
    695698WX_RESCOMP
    696699WX_VERSION
    697700WX_LIBS_STATIC
    $as_echo_n "checking for wxWidgets version >= $min_wx_version... " >&6; }  
    1598715990$as_echo_n "checking for wxWidgets version >= $min_wx_version (--unicode=yes --universal=no)... " >&6; }
    1598815991    fi
    1598915992
    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"
    1599115994
    1599215995    WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null`
    1599315996    wx_config_major_version=`echo $WX_VERSION | \
    $as_echo_n "checking for wxWidgets version >= $min_wx_version (--unicode=yes --u  
    1602616029
    1602716030
    1602816031    if test -n "$wx_ver_ok"; then
    16029 
    1603016032      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $WX_VERSION)" >&5
    1603116033$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`
    1603316035
    1603416036                              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wxWidgets static library" >&5
    1603516037$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`
    1603716039      if test "x$WX_LIBS_STATIC" = "x"; then
    1603816040        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
    1603916041$as_echo "no" >&6; }
    $as_echo "yes" >&6; }  
    1607616078      fi
    1607716079
    1607816080      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`
    1608016082         WX_CPPFLAGS=$WX_CFLAGS
    1608116083         WX_CXXFLAGS=$WX_CFLAGS
    1608216084
    1608316085         WX_CFLAGS_ONLY=$WX_CFLAGS
    1608416086         WX_CXXFLAGS_ONLY=$WX_CFLAGS
    1608516087      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`
    1608916091
    1609016092         WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"`
    1609116093         WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"`
    $as_echo "no (version $WX_VERSION is not new enough)" >&6; }  
    1610916111       WX_LIBS=""
    1611016112       WX_LIBS_STATIC=""
    1611116113       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
    1611316140
    1611416141    fi
    1611516142  else
    $as_echo "no (version $WX_VERSION is not new enough)" >&6; }  
    1613516162
    1613616163
    1613716164
     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
    1613816172  if test "$wxWin" != 1; then
    1613916173    as_fn_error $? "
    1614016174        wxWidgets must be installed on your system
    $as_echo "no (version $WX_VERSION is not new enough)" >&6; }  
    1615016184        equivalent variable and wxWidgets version is $MIN_WX_VERSION or above.
    1615116185    " "$LINENO" 5
    1615216186  fi
    16153   if test "$wx_config_major_version" -gt "2" || test "$wx_config_minor_version" -gt "8"; then
    16154     as_fn_error $? "You need to use wxWidgets 2.8.x to compile this program." "$LINENO" 5
    16155   fi
    1615616187
    1615716188  # --universal=no doesn't work correctly, it still accepts universal builds. Reject it manually here.
    1615816189  if echo "$WX_CPPFLAGS" | grep __WXUNIVERSAL__ > /dev/null; then
  • src/engine/local_path.cpp

    old new bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/)  
    4848
    4949    wxChar* out;
    5050    wxChar* start;
     51    wxStringBuffer* buffer = 0;
    5152    if (*in == '\\')
    5253    {
    5354        // possibly UNC
    bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/)  
    5960            return false;
    6061        }
    6162
    62         start = m_path.GetWriteBuf(path.Len() + 2);
     63        buffer = new wxStringBuffer(m_path, path.Len() + 2);
     64        start = *buffer;
    6365        out = start;
    6466        *out++ = '\\';
    6567        *out++ = '\\';
    bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/)  
    7779        {
    7880            // not a valid UNC path
    7981            *start = 0;
    80             m_path.UngetWriteBuf( 0 );
     82            delete buffer;
    8183            return false;
    8284        }
    8385
    bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/)  
    8789    {
    8890        // Regular path
    8991
    90         start = m_path.GetWriteBuf(path.Len() + 2);
     92        buffer = new wxStringBuffer(m_path, path.Len() + 2);
     93        start = *buffer;
    9194        out = start;
    9295        *out++ = *in++;
    9396
    9497        if (*in++ != ':')
    9598        {
    9699            *start = 0;
    97             m_path.UngetWriteBuf( 0 );
     100            delete buffer;
    98101            return false;
    99102        }
    100103        *out++ = ':';
    101104        if (*in != '/' && *in != '\\' && *in)
    102105        {
    103106            *start = 0;
    104             m_path.UngetWriteBuf( 0 );
     107            delete buffer;
    105108            return false;
    106109        }
    107110        *out++ = path_separator;
    bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/)  
    120123        return false;
    121124    }
    122125
     126#if wxCHECK_VERSION(2, 9, 0)
     127    wxStringBuffer* buffer = new wxStringBuffer(m_path, path.Len() + 2);
     128    wxChar* out = *buffer;
     129#else
    123130    wxChar* start = m_path.GetWriteBuf(path.Len() + 2);
    124131    wxChar* out = start;
     132#endif
    125133
    126134    *out++ = '/';
    127135    segments.push_back(out);
    bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/)  
    210218    }
    211219
    212220    *out = 0;
    213 
     221#if !wxCHECK_VERSION(2, 9, 0)
    214222    m_path.UngetWriteBuf( out - start );
    215 
     223#else
     224    if (buffer != 0) {
     225        delete buffer;
     226    }
     227#endif
    216228    ::Coalesce(m_path);
    217229
    218230    return true;
  • src/engine/logging.cpp

    old new CLogging::~CLogging()  
    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, int value1, wxCStrData value2, wxCStrData value3) const
     66{
     67        LogMessage(nMessageType, msgFormat, (const char*)(wxString() << value1).c_str(), value2.AsWChar(), value3.AsWChar());
     68}
     69
     70void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1) const
     71{
     72        LogMessage(nMessageType, msgFormat, value1.AsWChar());
     73}
     74
     75void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2) const
     76{
     77        LogMessage(nMessageType, msgFormat, value1.AsWChar(), value2.AsWChar());
     78}
     79
     80void 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
    5486void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, ...) const
    5587{
    5688    InitLogFile();
  • src/engine/logging_private.h

    old new public:  
    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, 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
     18
    1019    void LogMessage(MessageType nMessageType, const wxChar *msgFormat, ...) const;
    1120    void LogMessageRaw(MessageType nMessageType, const wxChar *msg) const;
    1221    void LogMessage(wxString sourceFile, int nSourceLine, void *pInstance, MessageType nMessageType, const wxChar *msgFormat, ...) const;
  • src/engine/misc.cpp

    old new void MakeLowerAscii(wxString& str)  
    365365{
    366366    for (size_t i = 0; i < str.Len(); i++)
    367367    {
     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        } else if (c == 0x130 || c == 0x131) {
     376            c = 'i';
     377            str.SetChar(i, wxUniChar(c));
     378        }
     379#else
    368380        wxChar& c = str[i];
    369381        if (c >= 'A' && c <= 'Z')
    370382            c += 32;
    371383        else if (c == 0x130 || c == 0x131)
    372384            c = 'i';
     385#endif
    373386    }
    374387}
    375388
  • src/engine/server.cpp

    old new struct t_protocolInfo  
    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

    old new wxString CServerPath::GetSafePath() const  
    272272        len += iter->Length() + 2 + INTLENGTH;
    273273
    274274    wxString safepath;
     275#if wxCHECK_VERSION(2, 9, 0)
     276    wxStringBuffer* buffer = new wxStringBuffer(safepath, len);
     277    wxChar* t = *buffer;
     278#else
    275279    wxChar* start = safepath.GetWriteBuf(len);
    276280    wxChar* t = start;
     281#endif
    277282
    278283    t = fast_sprint_number(t, m_type);
    279284    *(t++) = ' ';
    wxString CServerPath::GetSafePath() const  
    295300        t += iter->size();
    296301    }
    297302    *t = 0;
    298 
     303#if !wxCHECK_VERSION(2, 9, 0)
    299304    safepath.UngetWriteBuf( t - start );
     305#else
     306    delete buffer;
     307#endif
    300308    safepath.Shrink();
    301309
    302310    return safepath;
  • src/engine/socket.cpp

    old new void CSocket::SetEventHandler(CSocketEventHandler* pEvtHandler)  
    12731273    }
    12741274}
    12751275
    1276 #define ERRORDECL(c, desc) { c, _T(#c), wxTRANSLATE(desc) },
     1276#define ERRORDECL(c, desc) { c, _T(#c), _T(desc) },
    12771277
    12781278struct Error_table
    12791279{
  • src/engine/string_coalescer.cpp

    old new struct fast_equal  
    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

    old new  
    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

    old new bool CFileZillaApp::OnInit()  
    267267#else
    268268        if (!pInfo || !SetLocale(pInfo->Language))
    269269        {
    270             if (pInfo && pInfo->Description)
     270            if (pInfo && !pInfo->Description.IsEmpty())
    271271                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);
    272272            else
    273273                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()  
    803803    if (!found)
    804804    {
    805805        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);
    807807        executable.clear();
    808808    }
    809809#endif
  • src/interface/Mainfrm.cpp

    old new void CMainFrame::OnMenuHandler(wxCommandEvent &event)  
    754754            // Do a crude approach: Drop everything unexpected...
    755755            for (unsigned int i = 0; i < version.Len(); i++)
    756756            {
     757#if wxCHECK_VERSION(2, 9, 0)
     758                char c;
     759                version.GetChar(i).GetAsChar(&c);
     760#else
    757761                wxChar& c = version[i];
     762#endif
    758763                if ((version[i] >= '0' && version[i] <= '9') ||
    759764                    (version[i] >= 'a' && version[i] <= 'z') ||
    760765                    (version[i] >= 'A' && version[i] <= 'Z') ||
    761766                    version[i] == '-' || version[i] == '.' ||
    762767                    version[i] == '_')
    763768                {
    764                     url += c;
     769                    url.Append(c);
    765770                }
    766771            }
    767772        }
    void CMainFrame::OnMenuHandler(wxCommandEvent &event)  
    779784            {
    780785                pStatusBar->Show(show);
    781786                wxSizeEvent evt;
     787#if wxCHECK_VERSION(2, 9, 0)
     788                controls->pLocalListViewPanel->ProcessWindowEvent(evt);
     789#else
    782790                controls->pLocalListViewPanel->ProcessEvent(evt);
     791#endif
    783792            }
    784793        }
    785794        if (controls && controls->pRemoteListViewPanel)
    void CMainFrame::OnMenuHandler(wxCommandEvent &event)  
    789798            {
    790799                pStatusBar->Show(show);
    791800                wxSizeEvent evt;
     801#if wxCHECK_VERSION(2, 9, 0)
     802                controls->pRemoteListViewPanel->ProcessWindowEvent(evt);
     803#else
    792804                controls->pRemoteListViewPanel->ProcessEvent(evt);
     805#endif
    793806            }
    794807        }
    795808    }
  • src/interface/QueueView.cpp

    old new wxString CQueueView::ReplaceInvalidCharacters(const wxString& filename)  
    34233423    const wxChar replace = COptions::Get()->GetOption(OPTION_INVALID_CHAR_REPLACE)[0];
    34243424
    34253425    wxString result;
    3426 
     3426#if wxCHECK_VERSION(2, 9, 0)
     3427    wxStringBuffer* buffer = new wxStringBuffer(result, filename.Len() + 1);
     3428    wxChar* buf = *buffer;
     3429#else
    34273430    wxChar* start = result.GetWriteBuf(filename.Len() + 1);
    34283431    wxChar* buf = start;
     3432#endif
    34293433
    34303434    const wxChar* p = filename.c_str();
    34313435    while (*p)
    wxString CQueueView::ReplaceInvalidCharacters(const wxString& filename)  
    34603464        p++;
    34613465    }
    34623466    *buf = 0;
    3463 
     3467#if wxCHECK_VERSION(2, 9, 0)
     3468    delete buffer;
     3469#else
    34643470    result.UngetWriteBuf( buf - start );
    3465 
     3471#endif
    34663472    return result;
    34673473}
    34683474
  • src/interface/RemoteTreeView.cpp

    old new void CRemoteTreeView::SetDirectoryListing(const CSharedPointer<const CDirectoryL  
    350350    SetItemImages(parent, false);
    351351
    352352#ifndef __WXMSW__
    353     m_freezeCount--;
     353    Thaw();
    354354#endif
    355355    if (!modified)
    356356        SafeSelectItem(parent);
  • src/interface/StatusView.cpp

    old new public:  
    7171    {
    7272        wxWindow* parent = GetParent();
    7373        event.SetEventObject(parent);
    74         parent->ProcessEvent(event);
     74        parent->GetEventHandler()->ProcessEvent(event);
    7575    }
    7676#else
    7777    void OnKeyDown(wxKeyEvent& event)
    public:  
    8989        navEvent.SetDirection(!event.ShiftDown());
    9090        navEvent.SetFromTab(true);
    9191        navEvent.ResumePropagation(1);
    92         parent->ProcessEvent(navEvent);
     92        parent->GetEventHandler()->ProcessEvent(navEvent);
    9393    }
    9494#endif
    9595};
  • src/interface/aui_notebook_ex.cpp

    old new  
    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
    public:  
    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;
    public:  
    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
    public:  
    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        {
     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
    264284            if (m_base_colour.Red() + m_base_colour.Green() + m_base_colour.Blue() >= 384)
    265285                m_base_colour = wxColour( m_base_colour.Red() * 0.95, m_base_colour.Green() * 0.95, m_base_colour.Blue() * 0.95 );
     286#endif
    266287
    267288            dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
    268289            if (m_pNotebook->Highlighted(m_pNotebook->GetPageIndex(pane.window)))
    public:  
    270291                if (!m_fonts_initialized)
    271292                {
    272293                    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
    273298                    m_original_normal_font = m_normal_font;
    274299                    m_highlighted_font = m_normal_font;
     300#endif
    275301                    m_highlighted_font.SetWeight(wxFONTWEIGHT_BOLD);
    276302                    m_highlighted_font.SetStyle(wxFONTSTYLE_ITALIC);
    277303                }
     304#if wxCHECK_VERSION(2, 9, 0)
     305                m_normalFont = m_highlighted_font;
     306#else
    278307                m_normal_font = m_highlighted_font;
     308#endif
    279309            }
    280310            else if (m_fonts_initialized)
     311#if wxCHECK_VERSION(2, 9, 0)
     312                m_normalFont = m_original_normal_font;
     313#else
    281314                m_normal_font = m_original_normal_font;
     315#endif
    282316        }
    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
    284322        CFilterDC filter_dc(dc, pane.active ? 1 : 0, (m_tab_ctrl_height % 2) != 0, m_bottom);
    285323        wxAuiDefaultTabArt::DrawTab(*((wxDC*)&filter_dc), wnd, pane, in_rect, close_button_state, out_tab_rect, out_button_rect, x_extent);
    286 
    287324        m_base_colour = wxSystemSettings::GetColour(TABCOLOUR);
     325#endif
    288326    }
    289327
    290328    virtual void DrawBackground(wxDC& dc, wxWindow* wnd, const wxRect& rect)
    291329    {
     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
    292334        CFilterDC filter_dc(dc, 2, (m_tab_ctrl_height % 2) != 0, m_bottom);
    293335        wxAuiDefaultTabArt::DrawBackground(*((wxDC*)&filter_dc), wnd, rect);
     336#endif
    294337    }
    295338protected:
    296339    wxAuiNotebookEx* m_pNotebook;
  • src/interface/commandqueue.cpp

    old new void CCommandQueue::GrantExclusiveEngineRequest()  
    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/filezilla.h

    old new  
    7171#include <wx/toolbar.h>
    7272#include <wx/treectrl.h>
    7373#include <wx/xrc/xmlres.h>
     74#include <wx/xml/xml.h>
    7475
    7576#endif
  • src/interface/import.cpp

    old new wxString CImportDialog::DecodeLegacyPassword(wxString pass)  
    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/listctrlex.cpp

    old new wxListCtrlEx::~wxListCtrlEx()  
    7373#ifndef __WXMSW__
    7474wxScrolledWindow* wxListCtrlEx::GetMainWindow() const
    7575{
    76 #ifdef __WXMAC__
     76#if defined(__WXMAC__) && !wxCHECK_VERSION(2, 9, 0)
    7777    return (wxScrolledWindow*)m_genericImpl->m_mainWin;
    7878#else
    7979    return (wxScrolledWindow*)m_mainWin;
  • src/interface/netconfwizard.cpp

    old new void CNetConfWizard::SendNextCommand()  
    777777            wxString hexIP = ip;
    778778            for (unsigned int i = 0; i < hexIP.Length(); i++)
    779779            {
     780#if wxCHECK_VERSION(2, 9, 0)
     781                char c;
     782                hexIP.GetChar(i).GetAsChar(&c);
     783#else
    780784                wxChar& c = hexIP[i];
     785#endif
    781786                if (c == '.')
    782787                    c = '-';
    783788                else
  • src/interface/queue.cpp

    old new void CQueueViewBase::DisplayNumberQueuedFiles()  
    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;
    void CQueueViewBase::RefreshItem(const CQueueItem* pItem)  
    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

    old new struct fast_equal  
    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
    bool CQueueStorage::Impl::Bind(sqlite3_stmt* statement, int index, wxLongLong_t  
    561565extern "C" {
    562566static void custom_free(void* v)
    563567{
    564 #ifdef __WXMSW__
     568#if defined(__WXMSW__)
     569#if !wxCHECK_VERSION(2, 9, 0)
    565570    wxStringData* data = reinterpret_cast<wxStringData*>(v) - 1;
    566571    data->Unlock();
     572#endif
    567573#else
    568574    char* s = reinterpret_cast<char*>(v);
    569575    delete [] s;
    static void custom_free(void* v)  
    574580bool CQueueStorage::Impl::Bind(sqlite3_stmt* statement, int index, const wxString& value)
    575581{
    576582#ifdef __WXMSW__
     583#if wxCHECK_VERSION(2, 9, 0)
     584    char* data = value.char_str();
     585    return sqlite3_bind_text16(statement, index, data, value.length(), custom_free) == SQLITE_OK;
     586#else
    577587    // Increase string reference and pass the data to sqlite with a custom deallocator that
    578588    // reduces the reference once sqlite is done with it.
    579589    wxStringData* data = reinterpret_cast<wxStringData*>(const_cast<wxChar*>(value.c_str())) - 1;
    580590    data->Lock();
    581591    return sqlite3_bind_text16(statement, index, data + 1, data->nDataLength * 2, custom_free) == SQLITE_OK;
     592#endif
    582593#else
    583594    char* out = new char[value.size() * 2];
    584595    size_t outlen = utf16_.FromWChar(out, value.size() * 2, value.c_str(), value.size());
    wxString CQueueStorage::Impl::GetColumnText(sqlite3_stmt* statement, int index,  
    831842    int len = sqlite3_column_bytes16(statement, index);
    832843    if (text)
    833844    {
     845#if wxCHECK_VERSION(2, 9, 0)
     846        wxStringBuffer* buffer = new wxStringBuffer(ret, len);
     847        wxChar* out = *buffer;
     848#else
    834849        wxChar* out = ret.GetWriteBuf( len );
     850#endif
    835851        int outlen = utf16_.ToWChar( out, len, text, len );
     852#if wxCHECK_VERSION(2, 9, 0)
     853        delete buffer;
     854#else
    836855        ret.UngetWriteBuf( outlen );
     856#endif
    837857        if (shrink)
    838858            ret.Shrink();
    839859    }
  • src/interface/quickconnectbar.cpp

    old new void CQuickconnectBar::OnKeyboardNavigation(wxNavigationKeyEvent& event)  
    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

    old new  
    427427              </object>
    428428              <cols>1</cols>
    429429              <vgap>3</vgap>
    430               <rows>2</rows>
     430              <rows>3</rows>
    431431            </object>
    432432            <flag>wxLEFT|wxRIGHT|wxBOTTOM</flag>
    433433            <border>4</border>
     
    632632              <object class="sizeritem">
    633633                <object class="wxListCtrl" name="ID_KEYS">
    634634                  <style>wxLC_REPORT|wxSUNKEN_BORDER</style>
     635                  <size>400,-1</size>
    635636                </object>
    636                 <option>1</option>
    637                 <flag>wxGROW</flag>
     637                <flag>wxSHAPED</flag>
    638638              </object>
    639639              <vgap>5</vgap>
    640640              <growablecols>0</growablecols>
     
    13681368          <object class="sizeritem">
    13691369            <object class="wxFlexGridSizer">
    13701370              <cols>2</cols>
    1371               <rows>2</rows>
     1371              <rows>3</rows>
    13721372              <object class="sizeritem">
    13731373                <object class="wxStaticText">
    13741374                  <label>&amp;Theme:</label>
     
    20812081                  </object>
    20822082                  <growablecols>1</growablecols>
    20832083                </object>
    2084                 <flag>wxGROW</flag>
    20852084                <minsize>400,0</minsize>
    20862085              </object>
    20872086              <growablecols>0</growablecols>
  • src/interface/settings/optionspage_dateformatting.cpp

    old new bool COptionsPageDateFormatting::LoadPage()  
    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);
    bool COptionsPageDateFormatting::LoadPage()  
    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

    old new CSiteManagerItemData_Site* CSiteManager::GetSiteByPath(wxString sitePath)  
    515515
    516516bool CSiteManager::GetBookmarks(wxString sitePath, std::list<wxString> &bookmarks)
    517517{
     518    if (sitePath.IsEmpty())
     519        return false;
    518520    wxChar c = sitePath[0];
    519521    if (c != '0' && c != '1')
    520522        return false;
  • src/interface/statusbar.cpp

    old new void wxStatusBarEx::OnSize(wxSizeEvent& event)  
    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

    old new public:  
    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");
    public:  
    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

    old new class CComboBoxEx : public wxComboBox  
    2424{
    2525public:
    2626    CComboBoxEx(CViewHeader* parent)
    27         : wxComboBox(parent, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, wxArrayString(), wxCB_DROPDOWN | wxTE_PROCESS_ENTER | wxCB_SORT)
     27        : wxComboBox(parent, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, wxArrayString(), wxCB_DROPDOWN | wxTE_PROCESS_ENTER
     28#if !defined(__WXMAC__) || !wxCHECK_VERSION(2, 9, 0)
     29            | wxCB_SORT
     30#endif
     31    )
    2832    {
    2933        m_parent = parent;
    3034    }
    protected:  
    6771        navEvent.SetDirection(!event.ShiftDown());
    6872        navEvent.SetFromTab(true);
    6973        navEvent.ResumePropagation(1);
    70         m_parent->ProcessEvent(navEvent);
     74        m_parent->GetEventHandler()->ProcessEvent(navEvent);
    7175    }
    7276
    7377    void OnChar(wxKeyEvent& event)
  • src/interface/wrapengine.cpp

    old new bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe  
    232232    bool containsURL = false;
    233233    for (int i = 0; i <= strLen; i++)
    234234    {
    235         if ((text[i] == ':' && text[i + 1] == '/' && text[i + 2] == '/') || // absolute
    236             (text[i] == '/' && (!i || text[i - 1] == ' '))) // relative
     235        if ((i < strLen - 2 && text[i] == ':' && text[i + 1] == '/' && text[i + 2] == '/') || // absolute
     236            (i < strLen && text[i] == '/' && (!i || text[i - 1] == ' '))) // relative
    237237        {
    238238            url = true;
    239239            containsURL = true;
    240240        }
    241         if (text[i] != ' ' && text[i] != 0)
     241        if (i < strLen && text[i] != ' ')
    242242        {
    243243            // If url, wrap on slashes and ampersands, but not first slash of something://
    244244            if (!url ||
    245                  ((text[i] != '/' || text[i + 1] == '/') && (text[i] != '&' || text[i + 1] == '&') && text[i] != '?'))
     245                 ((i < strLen - 1 && (text[i] != '/' || text[i + 1] == '/')) && (i < strLen - 1 && (text[i] != '&' || text[i + 1] == '&')) && text[i] != '?'))
    246246            continue;
    247247        }
    248248
    249249        wxString segment;
    250250        if (wrapAfter == -1)
    251251        {
    252             if (text[i] == '/' || text[i] == '?' || text[i] == '&')
     252            if (i < strLen && (text[i] == '/' || text[i] == '?' || text[i] == '&'))
    253253                segment = text.Mid(start, i - start + 1);
    254254            else
    255255                segment = text.Mid(start, i - start);
    bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe  
    257257        }
    258258        else
    259259        {
    260             if (text[i] == '/' || text[i] == '?' || text[i] == '&')
     260            if (i < strLen && (text[i] == '/' || text[i] == '?' || text[i] == '&'))
    261261                segment = text.Mid(wrapAfter + 1, i - wrapAfter);
    262262            else
    263263                segment = text.Mid(wrapAfter + 1, i - wrapAfter - 1);
    bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe  
    272272            if (wrappedText != _T(""))
    273273                wrappedText += _T("\n");
    274274            wrappedText += text.Mid(start, wrapAfter - start);
    275             if (text[wrapAfter] != ' ' && text[wrapAfter] != '\0')
     275            if (wrapAfter < strLen && text[wrapAfter] != ' ' && text[wrapAfter] != '\0')
    276276                wrappedText += text[wrapAfter];
    277277
    278278            if (width + spaceWidth >= (int)maxLength)
    bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe  
    302302            if (wrappedText != _T(""))
    303303                wrappedText += _T("\n");
    304304            wrappedText += text.Mid(start, i - start);
    305             if (text[i] != ' ' && text[i] != '\0')
     305            if (i < strLen && text[i] != ' ' && text[i] != '\0')
    306306                wrappedText += text[i];
    307307            start = i + 1;
    308308            wrapAfter = -1;
    bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe  
    316316            wrapAfter = i;
    317317        }
    318318
    319         if (text[i] == ' ')
     319        if (i < strLen && text[i] == ' ')
    320320            url = false;
    321321    }
    322322    if (start < strLen)