tags 749128 + pending
thanks

Dear maintainer,

I've prepared an NMU for filezilla (versioned as 3.8.0-1.1) and uploaded
it to DELAYED/2.  Please feel free to tell me if I should delay it
longer.

Cheers,
    Olly
diff -Nru filezilla-3.8.0/debian/changelog filezilla-3.8.0/debian/changelog
--- filezilla-3.8.0/debian/changelog	2014-04-29 14:35:05.000000000 +1200
+++ filezilla-3.8.0/debian/changelog	2014-06-06 13:30:27.000000000 +1200
@@ -1,3 +1,11 @@
+filezilla (3.8.0-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Update to use wxWidgets 3.0 (new patch 02_wx3.0-compat.patch)
+    (Closes: #749128)
+
+ -- Olly Betts <[email protected]>  Fri, 06 Jun 2014 13:28:54 +1200
+
 filezilla (3.8.0-1) unstable; urgency=medium
 
   * New upstream release
diff -Nru filezilla-3.8.0/debian/control filezilla-3.8.0/debian/control
--- filezilla-3.8.0/debian/control	2014-04-29 14:35:05.000000000 +1200
+++ filezilla-3.8.0/debian/control	2014-05-23 16:02:46.000000000 +1200
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Adrien Cunin <[email protected]>
 Build-Depends: debhelper (>= 9), autotools-dev, pkg-config, dh-autoreconf,
- libwxgtk2.8-dev (>= 2.8.6) | libwxgtk-dev (>= 2.8.6), wx-common, libgtk2.0-dev,
+ libwxgtk3.0-dev, wx-common, libgtk2.0-dev,
  libidn11-dev, gettext, libgnutls-dev (>= 2.8.3), imagemagick, libdbus-1-dev,
  libtinyxml-dev, libsqlite3-dev
 Standards-Version: 3.9.5
diff -Nru filezilla-3.8.0/debian/patches/02_wx3.0-compat.patch filezilla-3.8.0/debian/patches/02_wx3.0-compat.patch
--- filezilla-3.8.0/debian/patches/02_wx3.0-compat.patch	1970-01-01 12:00:00.000000000 +1200
+++ filezilla-3.8.0/debian/patches/02_wx3.0-compat.patch	2014-05-24 18:53:17.000000000 +1200
@@ -0,0 +1,940 @@
+Description: Fix to compile with wx3.0
+ Patch adapted from macports.
+Author: [email protected]
+Last-Update: 2014-05-23
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -111,9 +111,6 @@
+         equivalent variable and wxWidgets version is $MIN_WX_VERSION or above.
+     ])
+   fi
+-  if test "$wx_config_major_version" -gt "2" || test "$wx_config_minor_version" -gt "8"; then
+-    AC_MSG_ERROR([You need to use wxWidgets 2.8.x to compile this program.])
+-  fi
+ 
+   # --universal=no doesn't work correctly, it still accepts universal builds. Reject it manually here.
+   if echo "$WX_CPPFLAGS" | grep __WXUNIVERSAL__ > /dev/null; then
+--- a/src/engine/local_path.cpp
++++ b/src/engine/local_path.cpp
+@@ -48,6 +48,7 @@
+ 
+ 	wxChar* out;
+ 	wxChar* start;
++	wxStringBuffer* buffer = 0;
+ 	if (*in == '\\')
+ 	{
+ 		// possibly UNC
+@@ -59,7 +60,8 @@
+ 			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 @@
+ 		{
+ 			// not a valid UNC path
+ 			*start = 0;
+-			m_path.UngetWriteBuf( 0 );
++			delete buffer;
+ 			return false;
+ 		}
+ 
+@@ -87,21 +89,22 @@
+ 	{
+ 		// 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 @@
+ 		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 @@
+ 	}
+ 
+ 	*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;
+--- a/src/engine/logging.cpp
++++ b/src/engine/logging.cpp
+@@ -51,6 +51,38 @@
+ 	}
+ }
+ 
++#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();
+--- a/src/engine/logging_private.h
++++ b/src/engine/logging_private.h
+@@ -7,6 +7,15 @@
+ 	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;
+ 	void LogMessage(wxString sourceFile, int nSourceLine, void *pInstance, MessageType nMessageType, const wxChar *msgFormat, ...) const;
+--- a/src/engine/misc.cpp
++++ b/src/engine/misc.cpp
+@@ -349,11 +349,24 @@
+ {
+ 	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 if (c == 0x130 || c == 0x131) {
++			c = 'i';
++			str.SetChar(i, wxUniChar(c));
++		}
++#else
+ 		wxChar& c = str[i];
+ 		if (c >= 'A' && c <= 'Z')
+ 			c += 32;
+ 		else if (c == 0x130 || c == 0x131)
+ 			c = 'i';
++#endif
+ 	}
+ }
+ 
+--- a/src/engine/server.cpp
++++ b/src/engine/server.cpp
+@@ -12,13 +12,13 @@
+ };
+ 
+ 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"),                             false  },
+-	{ HTTPS,        _T("https"),  true, 443,  true,  wxTRANSLATE("HTTPS - HTTP over TLS"),                                 false  },
+-	{ 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"),                                 false  },
++	{ 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(""), false }
+ };
+ 
+--- a/src/engine/serverpath.cpp
++++ b/src/engine/serverpath.cpp
+@@ -272,8 +272,13 @@
+ 		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++) = ' ';
+@@ -295,8 +300,11 @@
+ 		t += iter->size();
+ 	}
+ 	*t = 0;
+-
++#if !wxCHECK_VERSION(2, 9, 0)
+ 	safepath.UngetWriteBuf( t - start );
++#else
++	delete buffer;
++#endif
+ 	safepath.Shrink();
+ 
+ 	return safepath;
+--- a/src/engine/socket.cpp
++++ b/src/engine/socket.cpp
+@@ -1298,7 +1298,7 @@
+ 	}
+ }
+ 
+-#define ERRORDECL(c, desc) { c, _T(#c), wxTRANSLATE(desc) },
++#define ERRORDECL(c, desc) { c, _T(#c), _T(desc) },
+ 
+ struct Error_table
+ {
+--- a/src/engine/string_coalescer.cpp
++++ b/src/engine/string_coalescer.cpp
+@@ -67,7 +67,11 @@
+ 	{
+ 		// 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
+ 	}
+ };
+ 
+--- a/src/include/libfilezilla.h
++++ b/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>
+--- a/src/interface/FileZilla.cpp
++++ b/src/interface/FileZilla.cpp
+@@ -269,7 +269,7 @@
+ #else
+ 		if (!pInfo || !SetLocale(pInfo->Language))
+ 		{
+-			if (pInfo && pInfo->Description)
++			if (pInfo && !pInfo->Description.IsEmpty())
+ 				wxMessageBoxEx(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
+ 				wxMessageBoxEx(wxString::Format(_("Failed to set language to %s, using default system language"), language.c_str()), _("Failed to change language"), wxICON_EXCLAMATION);
+@@ -783,7 +783,7 @@
+ 	if (!found)
+ 	{
+ 		wxMessageBoxEx(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
+--- a/src/interface/Mainfrm.cpp
++++ b/src/interface/Mainfrm.cpp
+@@ -759,14 +759,19 @@
+ 			// 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);
+ 				}
+ 			}
+ 		}
+@@ -784,7 +789,11 @@
+ 			{
+ 				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)
+@@ -794,7 +803,11 @@
+ 			{
+ 				pStatusBar->Show(show);
+ 				wxSizeEvent evt;
++#if wxCHECK_VERSION(2, 9, 0)
++				controls->pRemoteListViewPanel->ProcessWindowEvent(evt);
++#else
+ 				controls->pRemoteListViewPanel->ProcessEvent(evt);
++#endif
+ 			}
+ 		}
+ 	}
+--- a/src/interface/QueueView.cpp
++++ b/src/interface/QueueView.cpp
+@@ -3451,9 +3451,13 @@
+ 	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)
+@@ -3488,9 +3492,11 @@
+ 		p++;
+ 	}
+ 	*buf = 0;
+-
++#if wxCHECK_VERSION(2, 9, 0)
++	delete buffer;
++#else
+ 	result.UngetWriteBuf( buf - start );
+-
++#endif
+ 	return result;
+ }
+ 
+--- a/src/interface/RemoteTreeView.cpp
++++ b/src/interface/RemoteTreeView.cpp
+@@ -350,7 +350,7 @@
+ 	SetItemImages(parent, false);
+ 
+ #ifndef __WXMSW__
+-	m_freezeCount--;
++	Thaw();
+ #endif
+ 	if (!modified)
+ 		SafeSelectItem(parent);
+--- a/src/interface/StatusView.cpp
++++ b/src/interface/StatusView.cpp
+@@ -71,7 +71,7 @@
+ 	{
+ 		wxWindow* parent = GetParent();
+ 		event.SetEventObject(parent);
+-		parent->ProcessEvent(event);
++		parent->GetEventHandler()->ProcessEvent(event);
+ 	}
+ #else
+ 	void OnKeyDown(wxKeyEvent& event)
+@@ -89,7 +89,7 @@
+ 		navEvent.SetDirection(!event.ShiftDown());
+ 		navEvent.SetFromTab(true);
+ 		navEvent.ResumePropagation(1);
+-		parent->ProcessEvent(navEvent);
++		parent->GetEventHandler()->ProcessEvent(navEvent);
+ 	}
+ #endif
+ };
+--- a/src/interface/aui_notebook_ex.cpp
++++ b/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 @@
+ 		}
+ 	}
+ 
+-#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 @@
+ 	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 @@
+ 						 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 @@
+ 				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;
+--- a/src/interface/commandqueue.cpp
++++ b/src/interface/commandqueue.cpp
+@@ -289,7 +289,7 @@
+ 
+ 	wxCommandEvent evt(fzEVT_GRANTEXCLUSIVEENGINEACCESS);
+ 	evt.SetId(m_requestId);
+-	m_pMainFrame->GetQueue()->AddPendingEvent(evt);
++	m_pMainFrame->GetQueue()->GetEventHandler()->AddPendingEvent(evt);
+ }
+ 
+ CFileZillaEngine* CCommandQueue::GetEngineExclusive(int requestId)
+--- a/src/interface/filezilla.h
++++ b/src/interface/filezilla.h
+@@ -72,5 +72,6 @@
+ #include <wx/toolbar.h>
+ #include <wx/treectrl.h>
+ #include <wx/xrc/xmlres.h>
++#include <wx/xml/xml.h>
+ 
+ #endif
+--- a/src/interface/import.cpp
++++ b/src/interface/import.cpp
+@@ -146,7 +146,7 @@
+ 			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;
+ 	}
+--- a/src/interface/listctrlex.cpp
++++ b/src/interface/listctrlex.cpp
+@@ -73,7 +73,7 @@
+ #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;
+--- a/src/interface/netconfwizard.cpp
++++ b/src/interface/netconfwizard.cpp
+@@ -777,7 +777,12 @@
+ 			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
+--- a/src/interface/queue.cpp
++++ b/src/interface/queue.cpp
+@@ -1310,7 +1310,7 @@
+ 	}
+ 	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::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)
+--- a/src/interface/queue_storage.cpp
++++ b/src/interface/queue_storage.cpp
+@@ -135,7 +135,11 @@
+ 	{
+ 		// 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
+ 	}
+ };
+ 
+@@ -561,9 +565,11 @@
+ 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;
+@@ -574,11 +580,16 @@
+ 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());
+@@ -831,9 +842,18 @@
+ 	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();
+ 	}
+--- a/src/interface/quickconnectbar.cpp
++++ b/src/interface/quickconnectbar.cpp
+@@ -222,12 +222,12 @@
+ 	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();
+--- a/src/interface/resources/settings.xrc
++++ b/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>
+@@ -1368,7 +1368,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>
+@@ -2080,7 +2080,6 @@
+                   </object>
+                   <growablecols>1</growablecols>
+                 </object>
+-                <flag>wxGROW</flag>
+                 <minsize>400,0</minsize>
+               </object>
+               <growablecols>0</growablecols>
+--- a/src/interface/settings/optionspage_dateformatting.cpp
++++ b/src/interface/settings/optionspage_dateformatting.cpp
+@@ -16,7 +16,7 @@
+ 	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 @@
+ 	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);
+--- a/src/interface/sitemanager.cpp
++++ b/src/interface/sitemanager.cpp
+@@ -525,6 +525,8 @@
+ 
+ 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;
+--- a/src/interface/statusbar.cpp
++++ b/src/interface/statusbar.cpp
+@@ -153,10 +153,10 @@
+ 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);
+--- a/src/interface/timeformatting.cpp
++++ b/src/interface/timeformatting.cpp
+@@ -23,7 +23,7 @@
+ 
+ 		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 @@
+ 
+ 		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");
+--- a/src/interface/viewheader.cpp
++++ b/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)
+--- a/src/interface/wrapengine.cpp
++++ b/src/interface/wrapengine.cpp
+@@ -232,24 +232,24 @@
+ 	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);
+@@ -257,7 +257,7 @@
+ 		}
+ 		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);
+@@ -272,7 +272,7 @@
+ 			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)
+@@ -302,7 +302,7 @@
+ 			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;
+@@ -316,7 +316,7 @@
+ 			wrapAfter = i;
+ 		}
+ 
+-		if (text[i] == ' ')
++		if (i < strLen && text[i] == ' ')
+ 			url = false;
+ 	}
+ 	if (start < strLen)
+--- a/src/engine/httpcontrolsocket.cpp
++++ b/src/engine/httpcontrolsocket.cpp
+@@ -424,7 +424,7 @@
+ 	}
+ 
+ 	if( !m_current_uri.HasScheme() || !m_current_uri.HasServer() || !m_current_uri.HasPath() ) {
+-		LogMessage(__TFILE__, __LINE__, this, Debug_Warning, _T("Invalid URI: %s"), m_current_uri.BuildURI().c_str());
++		LogMessage(__TFILE__, __LINE__, this, Debug_Warning, _T("Invalid URI: %s"), (const wxChar *)m_current_uri.BuildURI().c_str());
+ 		ResetOperation(FZ_REPLY_INTERNALERROR);
+ 		return FZ_REPLY_ERROR;
+ 	}
+--- a/src/interface/update_dialog.cpp
++++ b/src/interface/update_dialog.cpp
+@@ -8,6 +8,7 @@
+ #include "update_dialog.h"
+ #include "themeprovider.h"
+ 
++#include <wx/animate.h>
+ #include <wx/hyperlink.h>
+ 
+ BEGIN_EVENT_TABLE(CUpdateDialog, wxDialogEx)
+@@ -215,7 +216,7 @@
+ #else
+ 	bool program_exists = false;
+ 	wxString cmd = GetSystemOpenCommand(f, program_exists);
+-	if( program_exists && cmd ) {
++	if( program_exists && !cmd.empty() ) {
+ 		if (wxExecute(cmd))
+ 			return;
+ 	}
+--- a/m4/wxwin.m4
++++ b/m4/wxwin.m4
+@@ -145,7 +145,7 @@
+       AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version ($5)])
+     fi
+ 
+-    WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args $5 $4"
++    WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args $5"
+ 
+     WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null`
+     wx_config_major_version=`echo $WX_VERSION | \
+@@ -169,14 +169,14 @@
+     if test -n "$wx_ver_ok"; then
+ 
+       AC_MSG_RESULT(yes (version $WX_VERSION))
+-      WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs`
++      WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs $4`
+ 
+       dnl is this even still appropriate?  --static is a real option now
+       dnl and WX_CONFIG_WITH_ARGS is likely to contain it if that is
+       dnl what the user actually wants, making this redundant at best.
+       dnl For now keep it in case anyone actually used it in the past.
+       AC_MSG_CHECKING([for wxWidgets static library])
+-      WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs 2>/dev/null`
++      WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs $4 2>/dev/null`
+       if test "x$WX_LIBS_STATIC" = "x"; then
+         AC_MSG_RESULT(no)
+       else
diff -Nru filezilla-3.8.0/debian/patches/series filezilla-3.8.0/debian/patches/series
--- filezilla-3.8.0/debian/patches/series	2014-04-29 14:35:05.000000000 +1200
+++ filezilla-3.8.0/debian/patches/series	2014-05-23 16:29:53.000000000 +1200
@@ -1 +1,2 @@
 01_remove-xdg-check.patch
+02_wx3.0-compat.patch

Reply via email to