[110262] trunk/dports/www/FileZilla

mojca at macports.org mojca at macports.org
Thu Aug 29 03:29:15 PDT 2013


Revision: 110262
          https://trac.macports.org/changeset/110262
Author:   mojca at macports.org
Date:     2013-08-29 03:29:15 -0700 (Thu, 29 Aug 2013)
Log Message:
-----------
FileZilla: upgrade to version 3.7.3, adapt to use new wxWidgets ports, conditionally (un)usable with wxWidgets 2.9 (#38375, #35655)

Modified Paths:
--------------
    trunk/dports/www/FileZilla/Portfile

Added Paths:
-----------
    trunk/dports/www/FileZilla/files/
    trunk/dports/www/FileZilla/files/patch-src-putty-Makefile.in.diff
    trunk/dports/www/FileZilla/files/patch-wxWidgets-2.9.diff

Modified: trunk/dports/www/FileZilla/Portfile
===================================================================
--- trunk/dports/www/FileZilla/Portfile	2013-08-29 10:27:31 UTC (rev 110261)
+++ trunk/dports/www/FileZilla/Portfile	2013-08-29 10:29:15 UTC (rev 110262)
@@ -2,10 +2,10 @@
 # $Id$
 
 PortSystem          1.0
+PortGroup           wxWidgets 1.0
 
 name                FileZilla
-version             3.5.1
-revision            1
+version             3.7.3
 categories          www aqua
 platforms           darwin
 maintainers         strasweb.fr:rudloff openmaintainer
@@ -20,37 +20,64 @@
 homepage            http://filezilla-project.org/
 master_sites        sourceforge:project/filezilla/FileZilla_Client/${version}
 
-checksums           sha1    e4b2048cf8740e05cfff8e444a9059f79784e3f6 \
-                    rmd160  6f5c7e9db07cb1b5cc43de194f35a032a6f966b8
+checksums           sha1    34c3dd1943816a916c54e49cbbea51c97ef3f583 \
+                    rmd160  8fefebae9f2024dedab9841dc6fe3876305f8d2f
 
 depends_build       port:pkgconfig
 
-depends_lib         port:wxWidgets \
-                    port:libidn \
+depends_lib         port:libidn \
                     port:gettext \
                     port:libgpg-error \
                     port:libgcrypt \
                     port:gnutls \
-                    port:sqlite3
+                    port:sqlite3 \
+                    port:xdg-utils
 
-# wxWidgets is 32-bit only
-supported_archs     i386 ppc
-
-# wxWidgets is not universal
-universal_variant   no
-
 distname            ${name}_${version}_src
 use_bzip2           yes
 worksrcdir          filezilla-${version}
 
-# http://sourceforge.net/tracker/index.php?func=detail&aid=3031828&group_id=13559&atid=313559
+patchfiles          patch-wxWidgets-2.9.diff \
+                    patch-src-putty-Makefile.in.diff
+
+# http://trac.filezilla-project.org/ticket/5473
+# http://sourceforge.net/p/tinyxml/patches/51/
 configure.args      --with-tinyxml=builtin \
                     --disable-manualupdatecheck \
                     --disable-autoupdatecheck
 
-# cp: fzputtygen: No such file or directory
-use_parallel_build  no
+variant wxwidgets30 conflicts wxgtk28 wxwidgets28 description {Use wxWidgets 2.9 (not fully functional yet)} {
+    wxWidgets.use           wxWidgets-3.0
+    depends_lib-append      port:${wxWidgets.port}
+    configure.args-append   --with-wxdir=${wxWidgets.wxdir}
+    configure.env-append    WXRC=${wxWidgets.wxrc}
+}
 
-destroot {
-    copy ${worksrcpath}/FileZilla.app ${destroot}${applications_dir}
+variant wxwidgets28 conflicts wxgtk28 wxwidgets30 description {Use 32-bit Carbon-based wxWidgets 2.8} {
+    wxWidgets.use           wxWidgets-2.8
+    depends_lib-append      port:${wxWidgets.port}
+    configure.args-append   --with-wxdir=${wxWidgets.wxdir}
+    configure.env-append    WXRC=${wxWidgets.wxrc}
 }
+
+variant wxgtk28 conflicts wxwidgets28 wxwidgets30 description {Use wxWidgets 2.8 with GTK} {
+    wxWidgets.use           wxGTK-2.8
+    depends_lib-append      port:${wxWidgets.port}
+    configure.args-append   --with-wxdir=${wxWidgets.wxdir}
+    configure.env-append    WXRC=${wxWidgets.wxrc}
+}
+
+if {![variant_isset wxgtk28]} {
+    # TODO: when FileZilla is built against wxGTK, it doesn't create an app; this needs fixing
+    destroot {
+        copy ${worksrcpath}/FileZilla.app ${destroot}${applications_dir}
+    }
+}
+
+if {![variant_isset wxwidgets30] && ![variant_isset wxwidgets28] && ![variant_isset wxgtk28]} {
+    if {[vercmp $xcodeversion 4.4] >= 0} {
+        default_variants +wxgtk28
+    } else {
+        default_variants +wxwidgets28
+    }
+}

Added: trunk/dports/www/FileZilla/files/patch-src-putty-Makefile.in.diff
===================================================================
--- trunk/dports/www/FileZilla/files/patch-src-putty-Makefile.in.diff	                        (rev 0)
+++ trunk/dports/www/FileZilla/files/patch-src-putty-Makefile.in.diff	2013-08-29 10:29:15 UTC (rev 110262)
@@ -0,0 +1,13 @@
+http://trac.filezilla-project.org/ticket/8852
+avoids 'cp: fzputtygen: No such file or directory'
+--- src/putty/Makefile.in.orig
++++ src/putty/Makefile.in
+@@ -1526,7 +1526,7 @@ uninstall-am: uninstall-binPROGRAMS
+ 	uninstall-binPROGRAMS
+ 
+ 
+-$(top_builddir)/FileZilla.app/Contents/MacOS/fzsftp$(EXEEXT): fzsftp
++$(top_builddir)/FileZilla.app/Contents/MacOS/fzsftp$(EXEEXT): fzsftp fzputtygen
+ 	mkdir -p $(top_builddir)/FileZilla.app/Contents/MacOS
+ 	cp -f fzsftp $(top_builddir)/FileZilla.app/Contents/MacOS/fzsftp
+ 	cp -f fzputtygen $(top_builddir)/FileZilla.app/Contents/MacOS/fzputtygen

Added: trunk/dports/www/FileZilla/files/patch-wxWidgets-2.9.diff
===================================================================
--- trunk/dports/www/FileZilla/files/patch-wxWidgets-2.9.diff	                        (rev 0)
+++ trunk/dports/www/FileZilla/files/patch-wxWidgets-2.9.diff	2013-08-29 10:29:15 UTC (rev 110262)
@@ -0,0 +1,979 @@
+http://trac.filezilla-project.org/ticket/8272
+--- configure.orig
++++ configure
+@@ -692,6 +692,9 @@ PACKAGE_VERSION_MAJOR
+ WINDRESFLAGS
+ WINDRES
+ WX_CONFIG_WITH_ARGS
++WX_VERSION_MICRO
++WX_VERSION_MINOR
++WX_VERSION_MAJOR
+ WX_RESCOMP
+ WX_VERSION
+ WX_LIBS_STATIC
+@@ -15987,7 +15990,7 @@ $as_echo_n "checking for wxWidgets version >= $min_wx_version... " >&6; }
+ $as_echo_n "checking for wxWidgets version >= $min_wx_version (--unicode=yes --universal=no)... " >&6; }
+     fi
+ 
+-    WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args --unicode=yes --universal=no aui,xrc,adv,core,xml,net,base"
++            WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args --unicode=yes --universal=no"
+ 
+     WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null`
+     wx_config_major_version=`echo $WX_VERSION | \
+@@ -16026,14 +16029,13 @@ $as_echo_n "checking for wxWidgets version >= $min_wx_version (--unicode=yes --u
+ 
+ 
+     if test -n "$wx_ver_ok"; then
+-
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $WX_VERSION)" >&5
+ $as_echo "yes (version $WX_VERSION)" >&6; }
+-      WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs`
++      WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs aui,html,xrc,adv,core,xml,net,base`
+ 
+                               { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wxWidgets static library" >&5
+ $as_echo_n "checking for wxWidgets static library... " >&6; }
+-      WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs 2>/dev/null`
++      WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs aui,html,xrc,adv,core,xml,net,base 2>/dev/null`
+       if test "x$WX_LIBS_STATIC" = "x"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ $as_echo "no" >&6; }
+@@ -16076,16 +16078,16 @@ $as_echo "yes" >&6; }
+       fi
+ 
+       if test "x$wx_has_cppflags" = x ; then
+-                  WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
++                  WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags aui,html,xrc,adv,core,xml,net,base`
+          WX_CPPFLAGS=$WX_CFLAGS
+          WX_CXXFLAGS=$WX_CFLAGS
+ 
+          WX_CFLAGS_ONLY=$WX_CFLAGS
+          WX_CXXFLAGS_ONLY=$WX_CFLAGS
+       else
+-                  WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags`
+-         WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags`
+-         WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
++                  WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags aui,html,xrc,adv,core,xml,net,base`
++         WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags aui,html,xrc,adv,core,xml,net,base`
++         WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags aui,html,xrc,adv,core,xml,net,base`
+ 
+          WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"`
+          WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"`
+@@ -16109,7 +16111,32 @@ $as_echo "no (version $WX_VERSION is not new enough)" >&6; }
+        WX_LIBS=""
+        WX_LIBS_STATIC=""
+        WX_RESCOMP=""
+-       :
++
++       if test ! -z "--unicode=yes --universal=no"; then
++
++          wx_error_message="
++    The configuration you asked for $PACKAGE_NAME requires a wxWidgets
++    build with the following settings:
++        --unicode=yes --universal=no
++    but such build is not available.
++
++    To see the wxWidgets builds available on this system, please use
++    'wx-config --list' command. To use the default build, returned by
++    'wx-config --selected-config', use the options with their 'auto'
++    default values."
++
++       fi
++
++       wx_error_message="
++    The requested wxWidgets build couldn't be found.
++    $wx_error_message
++
++    If you still get this error, then check that 'wx-config' is
++    in path, the directory where wxWidgets libraries are installed
++    (returned by 'wx-config --libs' command) is in LD_LIBRARY_PATH
++    or equivalent variable and wxWidgets version is $MIN_WX_VERSION or above."
++
++       as_fn_error $? "$wx_error_message" "$LINENO" 5
+ 
+     fi
+   else
+@@ -16135,6 +16162,13 @@ $as_echo "no (version $WX_VERSION is not new enough)" >&6; }
+ 
+ 
+ 
++      WX_VERSION_MAJOR="$wx_config_major_version"
++  WX_VERSION_MINOR="$wx_config_minor_version"
++  WX_VERSION_MICRO="$wx_config_micro_version"
++
++
++
++
+   if test "$wxWin" != 1; then
+     as_fn_error $? "
+         wxWidgets must be installed on your system
+@@ -16150,8 +16184,8 @@ $as_echo "no (version $WX_VERSION is not new enough)" >&6; }
+         equivalent variable and wxWidgets version is $MIN_WX_VERSION or above.
+     " "$LINENO" 5
+   fi
+-  if test "$wx_config_major_version" -gt "2" || test "$wx_config_minor_version" -gt "8"; then
+-    as_fn_error $? "You need to use wxWidgets 2.8.x to compile this program." "$LINENO" 5
++  if test "$wx_config_major_version" -gt "2" || test "$wx_config_minor_version" -gt "9"; then
++    as_fn_error $? "You need to use wxWidgets 2.9.x to compile this program." "$LINENO" 5
+   fi
+ 
+   # --universal=no doesn't work correctly, it still accepts universal builds. Reject it manually here.
+--- src/engine/local_path.cpp.orig
++++ src/engine/local_path.cpp
+@@ -48,6 +48,7 @@ bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/)
+ 
+ 	wxChar* out;
+ 	wxChar* start;
++	wxStringBuffer* buffer = 0;
+ 	if (*in == '\\')
+ 	{
+ 		// possibly UNC
+@@ -59,7 +60,8 @@ bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/)
+ 			return false;
+ 		}
+ 
+-		start = m_path.GetWriteBuf(path.Len() + 2);
++		buffer = new wxStringBuffer(m_path, path.Len() + 2);
++		start = *buffer;
+ 		out = start;
+ 		*out++ = '\\';
+ 		*out++ = '\\';
+@@ -77,7 +79,7 @@ bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/)
+ 		{
+ 			// not a valid UNC path
+ 			*start = 0;
+-			m_path.UngetWriteBuf( 0 );
++			delete buffer;
+ 			return false;
+ 		}
+ 
+@@ -87,21 +89,22 @@ bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/)
+ 	{
+ 		// Regular path
+ 
+-		start = m_path.GetWriteBuf(path.Len() + 2);
++		buffer = new wxStringBuffer(m_path, path.Len() + 2);
++		start = *buffer;
+ 		out = start;
+ 		*out++ = *in++;
+ 
+ 		if (*in++ != ':')
+ 		{
+ 			*start = 0;
+-			m_path.UngetWriteBuf( 0 );
++			delete buffer;
+ 			return false;
+ 		}
+ 		*out++ = ':';
+ 		if (*in != '/' && *in != '\\' && *in)
+ 		{
+ 			*start = 0;
+-			m_path.UngetWriteBuf( 0 );
++			delete buffer;
+ 			return false;
+ 		}
+ 		*out++ = path_separator;
+@@ -120,8 +123,13 @@ bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/)
+ 		return false;
+ 	}
+ 
++#if wxCHECK_VERSION(2, 9, 0)
++	wxStringBuffer* buffer = new wxStringBuffer(m_path, path.Len() + 2);
++	wxChar* out = *buffer;
++#else
+ 	wxChar* start = m_path.GetWriteBuf(path.Len() + 2);
+ 	wxChar* out = start;
++#endif
+ 
+ 	*out++ = '/';
+ 	segments.push_back(out);
+@@ -210,9 +218,13 @@ bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/)
+ 	}
+ 
+ 	*out = 0;
+-
++#if !wxCHECK_VERSION(2, 9, 0)
+ 	m_path.UngetWriteBuf( out - start );
+-
++#else
++	if (buffer != 0) {
++		delete buffer;
++	}
++#endif
+ 	::Coalesce(m_path);
+ 
+ 	return true;
+--- src/engine/logging.cpp.orig
++++ src/engine/logging.cpp
+@@ -51,6 +51,38 @@ CLogging::~CLogging()
+ 	}
+ }
+ 
++#if wxCHECK_VERSION(2, 9, 0)
++void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1) const 
++{ 
++        LogMessage(nMessageType, msgFormat, (const char*)(wxString() << value1).c_str()); 
++} 
++
++void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1, wxCStrData value2) const 
++{ 
++        LogMessage(nMessageType, msgFormat, (const char*)(wxString() << value1).c_str(), value2.AsWChar()); 
++} 
++
++void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1, wxCStrData value2, wxCStrData value3) const 
++{ 
++        LogMessage(nMessageType, msgFormat, (const char*)(wxString() << value1).c_str(), value2.AsWChar(), value3.AsWChar()); 
++} 
++
++void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1) const 
++{ 
++        LogMessage(nMessageType, msgFormat, value1.AsWChar()); 
++} 
++
++void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2) const 
++{ 
++        LogMessage(nMessageType, msgFormat, value1.AsWChar(), value2.AsWChar()); 
++}
++
++void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2, wxCStrData value3, wxCStrData value4) const 
++{ 
++        LogMessage(nMessageType, msgFormat, value1.AsWChar(), value2.AsWChar(), value3.AsWChar(), value4.AsWChar()); 
++}
++#endif 
++
+ void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, ...) const
+ {
+ 	InitLogFile();
+--- src/engine/logging_private.h.orig
++++ src/engine/logging_private.h
+@@ -6,6 +6,15 @@ class CLogging
+ public:
+ 	CLogging(CFileZillaEnginePrivate *pEngine);
+ 	virtual ~CLogging();
++	
++#if wxCHECK_VERSION(2, 9, 0) 
++	void LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1) const; 
++	void LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1, wxCStrData value2) const;
++	void LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1, wxCStrData value2, wxCStrData value3) const;
++	void LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1) const; 
++	void LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2) const; 
++	void LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2, wxCStrData value3, wxCStrData value4) const; 
++#endif 
+ 
+ 	void LogMessage(MessageType nMessageType, const wxChar *msgFormat, ...) const;
+ 	void LogMessageRaw(MessageType nMessageType, const wxChar *msg) const;
+--- src/engine/misc.cpp.orig
++++ src/engine/misc.cpp
+@@ -365,9 +365,19 @@ void MakeLowerAscii(wxString& str)
+ {
+ 	for (size_t i = 0; i < str.Len(); i++)
+ 	{
++#if wxCHECK_VERSION(2, 9, 0)
++		char c;
++		str.GetChar(i).GetAsChar(&c);
++		if (c >= 'A' && c <= 'Z')
++		{
++			c += 32;
++			str.SetChar(i, wxUniChar(c));
++		}
++#else
+ 		wxChar& c = str[i];
+ 		if (c >= 'A' && c <= 'Z')
+ 			c += 32;
++#endif
+ 	}
+ }
+ 
+--- src/engine/server.cpp.orig
++++ src/engine/server.cpp
+@@ -12,13 +12,13 @@ struct t_protocolInfo
+ };
+ 
+ static const t_protocolInfo protocolInfos[] = {
+-	{ FTP,          _T("ftp"),    false, 21,  true,  wxTRANSLATE("FTP - File Transfer Protocol with optional encryption"),                 true  },
++	{ FTP,          _T("ftp"),    false, 21,  true,  _T("FTP - File Transfer Protocol with optional encryption"),                 true  },
+ 	{ SFTP,         _T("sftp"),   true,  22,  false, _T("SFTP - SSH File Transfer Protocol"),                              false },
+ 	{ HTTP,         _T("http"),   true,  80,  false, _T("HTTP - Hypertext Transfer Protocol"),                             true  },
+-	{ HTTPS,        _T("https"),  true, 443,  true,  wxTRANSLATE("HTTPS - HTTP over TLS"),                                 true  },
+-	{ FTPS,         _T("ftps"),   true, 990,  true,  wxTRANSLATE("FTPS - FTP over implicit TLS/SSL"),                      true  },
+-	{ FTPES,        _T("ftpes"),  true,  21,  true,  wxTRANSLATE("FTPES - FTP over explicit TLS/SSL"),                     true  },
+-	{ INSECURE_FTP, _T("ftp"),    false, 21,  true,  wxTRANSLATE("FTP - Insecure File Transfer Protocol"), true  },
++	{ HTTPS,        _T("https"),  true, 443,  true,  _T("HTTPS - HTTP over TLS"),                                 true  },
++	{ FTPS,         _T("ftps"),   true, 990,  true,  _T("FTPS - FTP over implicit TLS/SSL"),                      true  },
++	{ FTPES,        _T("ftpes"),  true,  21,  true,  _T("FTPES - FTP over explicit TLS/SSL"),                     true  },
++	{ INSECURE_FTP, _T("ftp"),    false, 21,  true,  _T("FTP - Insecure File Transfer Protocol"), true  },
+ 	{ UNKNOWN,      _T(""),       false, 21,  false, _T("") }
+ };
+ 
+--- src/engine/serverpath.cpp.orig
++++ src/engine/serverpath.cpp
+@@ -276,8 +276,13 @@ wxString CServerPath::GetSafePath() const
+ 		len += iter->Length() + 2 + INTLENGTH;
+ 
+ 	wxString safepath;
++#if wxCHECK_VERSION(2, 9, 0)
++	wxStringBuffer* buffer = new wxStringBuffer(safepath, len);
++	wxChar* t = *buffer;
++#else
+ 	wxChar* start = safepath.GetWriteBuf(len);
+ 	wxChar* t = start;
++#endif
+ 
+ 	t = fast_sprint_number(t, m_type);
+ 	*(t++) = ' ';
+@@ -299,8 +304,11 @@ wxString CServerPath::GetSafePath() const
+ 		t += iter->size();
+ 	}
+ 	*t = 0;
+-
++#if !wxCHECK_VERSION(2, 9, 0)
+ 	safepath.UngetWriteBuf( t - start );
++#else
++	delete buffer;
++#endif
+ 	safepath.Shrink();
+ 
+ 	return safepath;
+--- src/engine/socket.cpp.orig
++++ src/engine/socket.cpp
+@@ -1273,7 +1273,7 @@ void CSocket::SetEventHandler(CSocketEventHandler* pEvtHandler)
+ 	}
+ }
+ 
+-#define ERRORDECL(c, desc) { c, _T(#c), wxTRANSLATE(desc) },
++#define ERRORDECL(c, desc) { c, _T(#c), _T(desc) },
+ 
+ struct Error_table
+ {
+--- src/engine/string_coalescer.cpp.orig
++++ src/engine/string_coalescer.cpp
+@@ -66,7 +66,11 @@ struct fast_equal
+ 	{
+ 		// wxString is CoW, yet it doesn't even do this fast pointer
+ 		// comparison in it's less and/or equal operator(s).
++#if wxCHECK_VERSION(2, 9, 0)
++		return lhs == rhs;
++#else
+ 		return lhs.c_str() == rhs.c_str() || lhs == rhs;
++#endif
+ 	}
+ };
+ 
+--- src/include/libfilezilla.h.orig
++++ src/include/libfilezilla.h
+@@ -21,6 +21,10 @@
+ #include <wx/datetime.h>
+ #include <wx/event.h>
+ #include <wx/string.h>
++#if wxCHECK_VERSION(2, 9, 0)
++#include <wx/translation.h>
++#include <wx/dcclient.h>
++#endif
+ 
+ #include <list>
+ #include <vector>
+--- src/interface/FileZilla.cpp.orig
++++ src/interface/FileZilla.cpp
+@@ -267,7 +267,7 @@
+ #else
+ 		if (!pInfo || !SetLocale(pInfo->Language))
+ 		{
+-			if (pInfo && pInfo->Description)
++			if (pInfo && !pInfo->Description.IsEmpty())
+ 				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);
+ 			else
+ 				wxMessageBox(wxString::Format(_("Failed to set language to %s, using default system language"), language.c_str()), _("Failed to change language"), wxICON_EXCLAMATION);
+@@ -803,7 +803,7 @@ void CFileZillaApp::CheckExistsFzsftp()
+ 	if (!found)
+ 	{
+ 		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()),
+-			_("File not found"), wxICON_ERROR);
++			_("File not found"), wxICON_ERROR | wxOK);
+ 		executable.clear();
+ 	}
+ #endif
+--- src/interface/Mainfrm.cpp.orig
++++ src/interface/Mainfrm.cpp
+@@ -754,14 +754,19 @@ void CMainFrame::OnMenuHandler(wxCommandEvent &event)
+ 			// Do a crude approach: Drop everything unexpected...
+ 			for (unsigned int i = 0; i < version.Len(); i++)
+ 			{
++#if wxCHECK_VERSION(2, 9, 0)
++				char c;
++				version.GetChar(i).GetAsChar(&c);
++#else
+ 				wxChar& c = version[i];
++#endif
+ 				if ((version[i] >= '0' && version[i] <= '9') ||
+ 					(version[i] >= 'a' && version[i] <= 'z') ||
+ 					(version[i] >= 'A' && version[i] <= 'Z') ||
+ 					version[i] == '-' || version[i] == '.' ||
+ 					version[i] == '_')
+ 				{
+-					url += c;
++					url.Append(c);
+ 				}
+ 			}
+ 		}
+@@ -779,7 +784,11 @@ void CMainFrame::OnMenuHandler(wxCommandEvent &event)
+ 			{
+ 				pStatusBar->Show(show);
+ 				wxSizeEvent evt;
++#if wxCHECK_VERSION(2, 9, 0)
++				controls->pLocalListViewPanel->ProcessWindowEvent(evt);
++#else
+ 				controls->pLocalListViewPanel->ProcessEvent(evt);
++#endif
+ 			}
+ 		}
+ 		if (controls && controls->pRemoteListViewPanel)
+@@ -789,7 +798,11 @@ void CMainFrame::OnMenuHandler(wxCommandEvent &event)
+ 			{
+ 				pStatusBar->Show(show);
+ 				wxSizeEvent evt;
++#if wxCHECK_VERSION(2, 9, 0)
++				controls->pRemoteListViewPanel->ProcessWindowEvent(evt);
++#else
+ 				controls->pRemoteListViewPanel->ProcessEvent(evt);
++#endif
+ 			}
+ 		}
+ 	}
+--- src/interface/QueueView.cpp.orig
++++ src/interface/QueueView.cpp
+@@ -3419,9 +3419,13 @@ wxString CQueueView::ReplaceInvalidCharacters(const wxString& filename)
+ 	const wxChar replace = COptions::Get()->GetOption(OPTION_INVALID_CHAR_REPLACE)[0];
+ 
+ 	wxString result;
+-
++#if wxCHECK_VERSION(2, 9, 0)
++	wxStringBuffer* buffer = new wxStringBuffer(result, filename.Len() + 1);
++	wxChar* buf = *buffer;
++#else
+ 	wxChar* start = result.GetWriteBuf(filename.Len() + 1);
+ 	wxChar* buf = start;
++#endif
+ 
+ 	const wxChar* p = filename.c_str();
+ 	while (*p)
+@@ -3456,9 +3460,11 @@ wxString CQueueView::ReplaceInvalidCharacters(const wxString& filename)
+ 		p++;
+ 	}
+ 	*buf = 0;
+-
++#if wxCHECK_VERSION(2, 9, 0)
++	delete buffer;
++#else
+ 	result.UngetWriteBuf( buf - start );
+-
++#endif
+ 	return result;
+ }
+ 
+--- src/interface/RemoteTreeView.cpp.orig
++++ src/interface/RemoteTreeView.cpp
+@@ -350,7 +350,7 @@ void CRemoteTreeView::SetDirectoryListing(const CSharedPointer<const CDirectoryL
+ 	SetItemImages(parent, false);
+ 
+ #ifndef __WXMSW__
+-	m_freezeCount--;
++	Thaw();
+ #endif
+ 	if (!modified)
+ 		SafeSelectItem(parent);
+--- src/interface/StatusView.cpp.orig
++++ src/interface/StatusView.cpp
+@@ -58,7 +58,7 @@ public:
+ 	{
+ 		wxWindow* parent = GetParent();
+ 		event.SetEventObject(parent);
+-		parent->ProcessEvent(event);
++		parent->GetEventHandler()->ProcessEvent(event);
+ 	}
+ #else
+ 	void OnKeyDown(wxKeyEvent& event)
+@@ -76,7 +76,7 @@ public:
+ 		navEvent.SetDirection(!event.ShiftDown());
+ 		navEvent.SetFromTab(true);
+ 		navEvent.ResumePropagation(1);
+-		parent->ProcessEvent(navEvent);
++		parent->GetEventHandler()->ProcessEvent(navEvent);
+ 	}
+ #endif
+ };
+--- src/interface/aui_notebook_ex.cpp.orig
++++ src/interface/aui_notebook_ex.cpp
+@@ -3,7 +3,16 @@
+ #include "aui_notebook_ex.h"
+ #include <wx/dcmirror.h>
+ 
++#if wxCHECK_VERSION(2, 9, 0)
++wxColor wxAuiStepColour(const wxColor& c, int ialpha)
++{	
++	wxColor* result = new wxColor(c);
++	result->ChangeLightness(ialpha);
++	return *result;
++}
++#else
+ wxColor wxAuiStepColour(const wxColor& c, int ialpha);
++#endif
+ 
+ #ifdef __WXMSW__
+ #define TABCOLOUR wxSYS_COLOUR_3DFACE
+@@ -184,9 +193,6 @@ public:
+ 		}
+ 	}
+ 
+-#ifdef __WXGTK__
+-	virtual GdkWindow* GetGDKWindow() const { return m_original_dc->GetGDKWindow(); }
+-#endif
+ protected:
+ 	int m_gradient_called;
+ 	int m_rectangle_called;
+@@ -215,9 +221,15 @@ public:
+ 	virtual wxAuiTabArt* Clone()
+ 	{
+ 		wxAuiTabArtEx *art = new wxAuiTabArtEx(m_pNotebook, m_bottom, m_data);
++#if wxCHECK_VERSION(2, 9, 0)
++		art->SetNormalFont(m_normalFont);
++		art->SetSelectedFont(m_selectedFont);
++		art->SetMeasuringFont(m_measuringFont);
++#else
+ 		art->SetNormalFont(m_normal_font);
+ 		art->SetSelectedFont(m_selected_font);
+ 		art->SetMeasuringFont(m_measuring_font);
++#endif
+ 		return art;
+ 	}
+ 
+@@ -257,12 +269,21 @@ public:
+ 						 int* x_extent)
+ 	{
+ #ifndef __WXMAC__
++#if wxCHECK_VERSION(2, 9, 0)
++		m_baseColour = wxSystemSettings::GetColour(TABCOLOUR);
++#else
+ 		m_base_colour = wxSystemSettings::GetColour(TABCOLOUR);
+ #endif
++#endif
+ 		if (!pane.active)
+ 		{
++#if wxCHECK_VERSION(2, 9, 0)
++			if (m_baseColour.Red() + m_baseColour.Green() + m_baseColour.Blue() >= 384)
++				m_baseColour = wxColour( m_baseColour.Red() * 0.95, m_baseColour.Green() * 0.95, m_baseColour.Blue() * 0.95 );
++#else
+ 			if (m_base_colour.Red() + m_base_colour.Green() + m_base_colour.Blue() >= 384)
+ 				m_base_colour = wxColour( m_base_colour.Red() * 0.95, m_base_colour.Green() * 0.95, m_base_colour.Blue() * 0.95 );
++#endif
+ 
+ 			dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
+ 			if (m_pNotebook->Highlighted(m_pNotebook->GetPageIndex(pane.window)))
+@@ -270,27 +291,49 @@ public:
+ 				if (!m_fonts_initialized)
+ 				{
+ 					m_fonts_initialized = true;
++#if wxCHECK_VERSION(2, 9, 0)
++					m_original_normal_font = m_normalFont;
++					m_highlighted_font = m_normalFont;
++#else
+ 					m_original_normal_font = m_normal_font;
+ 					m_highlighted_font = m_normal_font;
++#endif
+ 					m_highlighted_font.SetWeight(wxFONTWEIGHT_BOLD);
+ 					m_highlighted_font.SetStyle(wxFONTSTYLE_ITALIC);
+ 				}
++#if wxCHECK_VERSION(2, 9, 0)
++				m_normalFont = m_highlighted_font;
++#else
+ 				m_normal_font = m_highlighted_font;
++#endif
+ 			}
+ 			else if (m_fonts_initialized)
++#if wxCHECK_VERSION(2, 9, 0)
++				m_normalFont = m_original_normal_font;
++#else
+ 				m_normal_font = m_original_normal_font;
++#endif
+ 		}
+-
++#if wxCHECK_VERSION(2, 9, 0)
++		CFilterDC filter_dc(dc, pane.active ? 1 : 0, (m_tabCtrlHeight % 2) != 0, m_bottom);
++		wxAuiGenericTabArt::DrawTab(*((wxDC*)&filter_dc), wnd, pane, in_rect, close_button_state, out_tab_rect, out_button_rect, x_extent);
++		m_baseColour = wxSystemSettings::GetColour(TABCOLOUR);
++#else
+ 		CFilterDC filter_dc(dc, pane.active ? 1 : 0, (m_tab_ctrl_height % 2) != 0, m_bottom);
+ 		wxAuiDefaultTabArt::DrawTab(*((wxDC*)&filter_dc), wnd, pane, in_rect, close_button_state, out_tab_rect, out_button_rect, x_extent);
+-
+ 		m_base_colour = wxSystemSettings::GetColour(TABCOLOUR);
++#endif
+ 	}
+ 
+ 	virtual void DrawBackground(wxDC& dc, wxWindow* wnd, const wxRect& rect)
+ 	{
++#if wxCHECK_VERSION(2, 9, 0)
++		CFilterDC filter_dc(dc, 2, (m_tabCtrlHeight % 2) != 0, m_bottom);
++		wxAuiGenericTabArt::DrawBackground(*((wxDC*)&filter_dc), wnd, rect);
++#else
+ 		CFilterDC filter_dc(dc, 2, (m_tab_ctrl_height % 2) != 0, m_bottom);
+ 		wxAuiDefaultTabArt::DrawBackground(*((wxDC*)&filter_dc), wnd, rect);
++#endif
+ 	}
+ protected:
+ 	wxAuiNotebookEx* m_pNotebook;
+--- src/interface/commandqueue.cpp.orig
++++ src/interface/commandqueue.cpp
+@@ -289,7 +289,7 @@ void CCommandQueue::GrantExclusiveEngineRequest()
+ 
+ 	wxCommandEvent evt(fzEVT_GRANTEXCLUSIVEENGINEACCESS);
+ 	evt.SetId(m_requestId);
+-	m_pMainFrame->GetQueue()->AddPendingEvent(evt);
++	m_pMainFrame->GetQueue()->GetEventHandler()->AddPendingEvent(evt);
+ }
+ 
+ CFileZillaEngine* CCommandQueue::GetEngineExclusive(int requestId)
+--- src/interface/filezilla.h.orig
++++ src/interface/filezilla.h
+@@ -71,5 +71,6 @@
+ #include <wx/toolbar.h>
+ #include <wx/treectrl.h>
+ #include <wx/xrc/xmlres.h>
++#include <wx/xml/xml.h>
+ 
+ #endif
+--- src/interface/import.cpp.orig
++++ src/interface/import.cpp
+@@ -146,7 +146,7 @@ wxString CImportDialog::DecodeLegacyPassword(wxString pass)
+ 			return _T("");
+ 		int number = (pass[i] - '0') * 100 +
+ 						(pass[i + 1] - '0') * 10 +
+-						pass[i + 2] - '0';
++						(pass[i + 2] - '0');
+ 		wxChar c = number ^ key[(i / 3 + pos) % strlen(key)];
+ 		output += c;
+ 	}
+--- src/interface/listctrlex.cpp.orig
++++ src/interface/listctrlex.cpp
+@@ -73,7 +73,7 @@ wxListCtrlEx::~wxListCtrlEx()
+ #ifndef __WXMSW__
+ wxScrolledWindow* wxListCtrlEx::GetMainWindow() const
+ {
+-#ifdef __WXMAC__
++#if defined(__WXMAC__) && !wxCHECK_VERSION(2, 9, 0)
+	return (wxScrolledWindow*)m_genericImpl->m_mainWin;
+ #else
+	return (wxScrolledWindow*)m_mainWin;
+--- src/interface/netconfwizard.cpp.orig
++++ src/interface/netconfwizard.cpp
+@@ -777,7 +777,12 @@ void CNetConfWizard::SendNextCommand()
+ 			wxString hexIP = ip;
+ 			for (unsigned int i = 0; i < hexIP.Length(); i++)
+ 			{
++#if wxCHECK_VERSION(2, 9, 0)
++				char c;
++				hexIP.GetChar(i).GetAsChar(&c);
++#else
+ 				wxChar& c = hexIP[i];
++#endif
+ 				if (c == '.')
+ 					c = '-';
+ 				else
+--- src/interface/queue.cpp.orig
++++ src/interface/queue.cpp
+@@ -1310,7 +1310,7 @@ void CQueueViewBase::DisplayNumberQueuedFiles()
+ 	}
+ 	else
+ 	{
+-		if (m_folderScanCount)
++		if (m_folderScanCount && m_fileCount > 0)
+ 			str.Printf(m_title + _T(" (0+)"), m_fileCount);
+ 		else
+ 			str = m_title;
+@@ -1442,7 +1442,11 @@ void CQueueViewBase::RefreshItem(const CQueueItem* pItem)
+ void CQueueViewBase::OnNavigationKey(wxNavigationKeyEvent& event)
+ {
+ 	event.SetEventObject(m_pQueue);
++#if wxCHECK_VERSION(2, 9, 0)
++	m_pQueue->ProcessWindowEvent(event);
++#else
+ 	m_pQueue->ProcessEvent(event);
++#endif
+ }
+ 
+ void CQueueViewBase::OnChar(wxKeyEvent& event)
+--- src/interface/queue_storage.cpp.orig
++++ src/interface/queue_storage.cpp
+@@ -135,7 +135,11 @@ struct fast_equal
+ 	{
+ 		// wxString is CoW, yet it doesn't even do this fast pointer
+ 		// comparison in it's less and/or equal operator(s).
++#if wxCHECK_VERSION(2, 9, 0)
++		return (const char*)lhs.c_str() == (const char*)rhs.c_str() || lhs == rhs;
++#else
+ 		return lhs.c_str() == rhs.c_str() || lhs == rhs;
++#endif
+ 	}
+ };
+ 
+@@ -544,9 +548,11 @@ bool CQueueStorage::Impl::Bind(sqlite3_stmt* statement, int index, wxLongLong_t
+ extern "C" {
+ static void custom_free(void* v)
+ {
+-#ifdef __WXMSW__
++#if defined(__WXMSW__)
++#if !wxCHECK_VERSION(2, 9, 0)
+ 	wxStringData* data = reinterpret_cast<wxStringData*>(v) - 1;
+ 	data->Unlock();
++#endif
+ #else
+ 	char* s = reinterpret_cast<char*>(v);
+ 	delete [] s;
+@@ -557,11 +563,16 @@ static void custom_free(void* v)
+ bool CQueueStorage::Impl::Bind(sqlite3_stmt* statement, int index, const wxString& value)
+ {
+ #ifdef __WXMSW__
++#if wxCHECK_VERSION(2, 9, 0)
++	char* data = value.char_str();
++	return sqlite3_bind_text16(statement, index, data, value.length(), custom_free) == SQLITE_OK;
++#else
+ 	// Increase string reference and pass the data to sqlite with a custom deallocator that
+ 	// reduces the reference once sqlite is done with it.
+ 	wxStringData* data = reinterpret_cast<wxStringData*>(const_cast<wxChar*>(value.c_str())) - 1;
+ 	data->Lock();
+ 	return sqlite3_bind_text16(statement, index, data + 1, data->nDataLength * 2, custom_free) == SQLITE_OK;
++#endif
+ #else
+ 	char* out = new char[value.size() * 2];
+ 	size_t outlen = utf16_.FromWChar(out, value.size() * 2, value.c_str(), value.size());
+@@ -814,9 +825,18 @@ wxString CQueueStorage::Impl::GetColumnText(sqlite3_stmt* statement, int index,
+ 	int len = sqlite3_column_bytes16(statement, index);
+ 	if (text)
+ 	{
++#if wxCHECK_VERSION(2, 9, 0)
++		wxStringBuffer* buffer = new wxStringBuffer(ret, len);
++		wxChar* out = *buffer;
++#else
+ 		wxChar* out = ret.GetWriteBuf( len );
++#endif
+ 		int outlen = utf16_.ToWChar( out, len, text, len );
++#if wxCHECK_VERSION(2, 9, 0)
++		delete buffer;
++#else
+ 		ret.UngetWriteBuf( outlen );
++#endif
+ 		if (shrink)
+ 			ret.Shrink();
+ 	}
+--- src/interface/quickconnectbar.cpp.orig
++++ src/interface/quickconnectbar.cpp
+@@ -222,12 +222,12 @@ void CQuickconnectBar::OnKeyboardNavigation(wxNavigationKeyEvent& event)
+ 	if (event.GetDirection() && event.GetEventObject() == XRCCTRL(*this, "ID_QUICKCONNECT_DROPDOWN", wxButton))
+ 	{
+ 		event.SetEventObject(this);
+-		GetParent()->ProcessEvent(event);
++		GetParent()->GetEventHandler()->ProcessEvent(event);
+ 	}
+ 	else if (!event.GetDirection() && event.GetEventObject() == m_pHost)
+ 	{
+ 		event.SetEventObject(this);
+-		GetParent()->ProcessEvent(event);
++		GetParent()->GetEventHandler()->ProcessEvent(event);
+ 	}
+ 	else
+ 		event.Skip();
+--- src/interface/resources/settings.xrc.orig
++++ src/interface/resources/settings.xrc
+@@ -427,7 +427,7 @@
+               </object>
+               <cols>1</cols>
+               <vgap>3</vgap>
+-              <rows>2</rows>
++              <rows>3</rows>
+             </object>
+             <flag>wxLEFT|wxRIGHT|wxBOTTOM</flag>
+             <border>4</border>
+@@ -632,9 +632,9 @@
+               <object class="sizeritem">
+                 <object class="wxListCtrl" name="ID_KEYS">
+                   <style>wxLC_REPORT|wxSUNKEN_BORDER</style>
++									<size>400,-1</size>
+                 </object>
+-                <option>1</option>
+-                <flag>wxGROW</flag>
++                <flag>wxSHAPED</flag>
+               </object>
+               <vgap>5</vgap>
+               <growablecols>0</growablecols>
+@@ -1363,7 +1363,7 @@
+           <object class="sizeritem">
+             <object class="wxFlexGridSizer">
+               <cols>2</cols>
+-              <rows>2</rows>
++              <rows>3</rows>
+               <object class="sizeritem">
+                 <object class="wxStaticText">
+                   <label>&amp;Theme:</label>
+@@ -2076,7 +2076,6 @@
+                   </object>
+                   <growablecols>1</growablecols>
+                 </object>
+-                <flag>wxGROW</flag>
+                 <minsize>400,0</minsize>
+               </object>
+               <growablecols>0</growablecols>
+--- src/interface/settings/optionspage_dateformatting.cpp.orig
++++ src/interface/settings/optionspage_dateformatting.cpp
+@@ -16,7 +16,7 @@ bool COptionsPageDateFormatting::LoadPage()
+ 	const wxString& dateFormat = m_pOptions->GetOption(OPTION_DATE_FORMAT);
+ 	if (dateFormat == _T("1"))
+ 		SetRCheck(XRCID("ID_DATEFORMAT_ISO"), true, failure);
+-	else if (dateFormat[0] == '2')
++	else if (!dateFormat.IsEmpty() && dateFormat[0] == '2')
+ 	{
+ 		SetRCheck(XRCID("ID_DATEFORMAT_CUSTOM"), true, failure);
+ 		SetText(XRCID("ID_CUSTOM_DATEFORMAT"), dateFormat.Mid(1), failure);
+@@ -27,7 +27,7 @@ bool COptionsPageDateFormatting::LoadPage()
+ 	const wxString& timeFormat = m_pOptions->GetOption(OPTION_TIME_FORMAT);
+ 	if (timeFormat == _T("1"))
+ 		SetRCheck(XRCID("ID_TIMEFORMAT_ISO"), true, failure);
+-	else if (timeFormat[0] == '2')
++	else if (!timeFormat.IsEmpty() && timeFormat[0] == '2')
+ 	{
+ 		SetRCheck(XRCID("ID_TIMEFORMAT_CUSTOM"), true, failure);
+ 		SetText(XRCID("ID_CUSTOM_TIMEFORMAT"), timeFormat.Mid(1), failure);
+--- src/interface/sitemanager.cpp.orig
++++ src/interface/sitemanager.cpp
+@@ -516,6 +516,8 @@ CSiteManagerItemData_Site* CSiteManager::GetSiteByPath(wxString sitePath)
+ 
+ bool CSiteManager::GetBookmarks(wxString sitePath, std::list<wxString> &bookmarks)
+ {
++	if (sitePath.IsEmpty())
++		return false;
+ 	wxChar c = sitePath[0];
+ 	if (c != '0' && c != '1')
+ 		return false;
+--- src/interface/statusbar.cpp.orig
++++ src/interface/statusbar.cpp
+@@ -153,10 +153,10 @@ void wxStatusBarEx::OnSize(wxSizeEvent& event)
+ void wxStatusBarEx::SetStatusText(const wxString& text, int number /*=0*/)
+ {
+ 	// Basically identical to the wx one, but not calling Update
+-	wxString oldText = m_statusStrings[number];
++	wxString oldText = GetStatusText(number);
+ 	if (oldText != text)
+ 	{
+-		m_statusStrings[number] = text;
++		wxStatusBar::SetStatusText(text, number);
+ 
+ 		wxRect rect;
+ 		GetFieldRect(number, rect);
+--- src/interface/timeformatting.cpp.orig
++++ src/interface/timeformatting.cpp
+@@ -23,7 +23,7 @@ public:
+ 
+ 		if (dateFormat == _T("1"))
+ 			m_dateFormat = _T("%Y-%m-%d");
+-		else if (dateFormat[0] == '2')
++		else if (!dateFormat.IsEmpty() && dateFormat[0] == '2')
+ 			m_dateFormat = dateFormat.Mid(1);
+ 		else
+ 			m_dateFormat = _T("%x");
+@@ -33,7 +33,7 @@ public:
+ 
+ 		if (timeFormat == _T("1"))
+ 			m_dateTimeFormat += _T("%H:%M");
+-		else if (timeFormat[0] == '2')
++		else if (!timeFormat.IsEmpty() && timeFormat[0] == '2')
+ 			m_dateTimeFormat += timeFormat.Mid(1);
+ 		else
+ 			m_dateTimeFormat += _T("%X");
+--- src/interface/viewheader.cpp.orig
++++ src/interface/viewheader.cpp
+@@ -24,7 +24,11 @@
+ {
+ public:
+ 	CComboBoxEx(CViewHeader* parent)
+-		: wxComboBox(parent, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, wxArrayString(), wxCB_DROPDOWN | wxTE_PROCESS_ENTER | wxCB_SORT)
++		: wxComboBox(parent, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, wxArrayString(), wxCB_DROPDOWN | wxTE_PROCESS_ENTER
++#if !defined(__WXMAC__) || !wxCHECK_VERSION(2, 9, 0)
++            | wxCB_SORT
++#endif
++    )
+ 	{
+ 		m_parent = parent;
+ 	}
+@@ -67,7 +71,7 @@
+ 		navEvent.SetDirection(!event.ShiftDown());
+ 		navEvent.SetFromTab(true);
+ 		navEvent.ResumePropagation(1);
+-		m_parent->ProcessEvent(navEvent);
++		m_parent->GetEventHandler()->ProcessEvent(navEvent);
+ 	}
+ 
+ 	void OnChar(wxKeyEvent& event)
+--- src/interface/wrapengine.cpp.orig
++++ src/interface/wrapengine.cpp
+@@ -234,24 +234,24 @@ bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe
+ 	bool containsURL = false;
+ 	for (int i = 0; i <= strLen; i++)
+ 	{
+-		if ((text[i] == ':' && text[i + 1] == '/' && text[i + 2] == '/') || // absolute
+-			(text[i] == '/' && (!i || text[i - 1] == ' '))) // relative
++		if ((i < strLen - 2 && text[i] == ':' && text[i + 1] == '/' && text[i + 2] == '/') || // absolute
++			(i < strLen && text[i] == '/' && (!i || text[i - 1] == ' '))) // relative
+ 		{
+ 			url = true;
+ 			containsURL = true;
+ 		}
+-		if (text[i] != ' ' && text[i] != 0)
++		if (i < strLen && text[i] != ' ')
+ 		{
+ 			// If url, wrap on slashes and ampersands, but not first slash of something://
+ 			if (!url ||
+-				 ((text[i] != '/' || text[i + 1] == '/') && (text[i] != '&' || text[i + 1] == '&') && text[i] != '?'))
++				 ((i < strLen - 1 && (text[i] != '/' || text[i + 1] == '/')) && (i < strLen - 1 && (text[i] != '&' || text[i + 1] == '&')) && text[i] != '?'))
+ 			continue;
+ 		}
+ 
+ 		wxString segment;
+ 		if (wrapAfter == -1)
+ 		{
+-			if (text[i] == '/' || text[i] == '?' || text[i] == '&')
++			if (i < strLen && (text[i] == '/' || text[i] == '?' || text[i] == '&'))
+ 				segment = text.Mid(start, i - start + 1);
+ 			else
+ 				segment = text.Mid(start, i - start);
+@@ -259,7 +259,7 @@ bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe
+ 		}
+ 		else
+ 		{
+-			if (text[i] == '/' || text[i] == '?' || text[i] == '&')
++			if (i < strLen && (text[i] == '/' || text[i] == '?' || text[i] == '&'))
+ 				segment = text.Mid(wrapAfter + 1, i - wrapAfter);
+ 			else
+ 				segment = text.Mid(wrapAfter + 1, i - wrapAfter - 1);
+@@ -274,7 +274,7 @@ bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe
+ 			if (wrappedText != _T(""))
+ 				wrappedText += _T("\n");
+ 			wrappedText += text.Mid(start, wrapAfter - start);
+-			if (text[wrapAfter] != ' ' && text[wrapAfter] != '\0')
++			if (wrapAfter < strLen && text[wrapAfter] != ' ' && text[wrapAfter] != '\0')
+ 				wrappedText += text[wrapAfter];
+ 
+ 			if (width + spaceWidth >= (int)maxLength)
+@@ -304,7 +304,7 @@ bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe
+ 			if (wrappedText != _T(""))
+ 				wrappedText += _T("\n");
+ 			wrappedText += text.Mid(start, i - start);
+-			if (text[i] != ' ' && text[i] != '\0')
++			if (i < strLen && text[i] != ' ' && text[i] != '\0')
+ 				wrappedText += text[i];
+ 			start = i + 1;
+ 			wrapAfter = -1;
+@@ -318,7 +318,7 @@ bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe
+ 			wrapAfter = i;
+ 		}
+ 
+-		if (text[i] == ' ')
++		if (i < strLen && text[i] == ' ')
+ 			url = false;
+ 	}
+ 	if (start < strLen)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130829/5b600881/attachment-0001.html>


More information about the macports-changes mailing list