amule: remove upstreamd patch

This commit is contained in:
CN_SZTL 2020-08-03 03:16:10 +08:00
parent 3ab2b7e44e
commit b3ff962bd7
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
2 changed files with 0 additions and 70 deletions

View File

@ -1,70 +0,0 @@
--- a/src/amule.h
+++ b/src/amule.h
@@ -194,6 +194,13 @@ public:
// derived classes may override those
virtual int InitGui(bool geometry_enable, wxString &geometry_string);
+ // The GTK wxApps sets its file name conversion properly
+ // in wxApp::Initialize(), while wxAppConsole::Initialize()
+ // does not, leaving wxConvFile being set to wxConvLibc. File
+ // name conversion should be set otherwise amuled will abort to
+ // handle non-ASCII file names which monolithic amule can handle.
+ // This function are overrided to perform this.
+ virtual bool Initialize(int& argc_, wxChar **argv_);
#ifndef ASIO_SOCKETS
// Socket handlers
--- a/src/amuled.cpp
+++ b/src/amuled.cpp
@@ -773,6 +773,41 @@ int CamuleDaemonApp::OnExit()
return CamuleApp::OnExit();
}
+bool CamuleDaemonApp::Initialize(int& argc_, wxChar **argv_)
+{
+ if ( !wxAppConsole::Initialize(argc_, argv_) ) {
+ return false;
+ }
+
+#ifdef __UNIX__
+ wxString encName;
+#if wxUSE_INTL
+ // if a non default locale is set,
+ // assume that the user wants his
+ // filenames in this locale too
+ encName = wxLocale::GetSystemEncodingName().Upper();
+
+ // But don't consider ASCII in this case.
+ if ( !encName.empty() ) {
+ if ( encName == wxT("US-ASCII") ) {
+ // This means US-ASCII when returned
+ // from GetEncodingFromName().
+ encName.clear();
+ }
+ }
+#endif // wxUSE_INTL
+
+ // in this case, UTF-8 is used by default.
+ if ( encName.empty() ) {
+ encName = wxT("UTF-8");
+ }
+
+ static wxConvBrokenFileNames fileconv(encName);
+ wxConvFileName = &fileconv;
+#endif // __UNIX__
+
+ return true;
+}
int CamuleDaemonApp::ShowAlert(wxString msg, wxString title, int flags)
{
--- a/src/libs/common/Path.cpp
+++ b/src/libs/common/Path.cpp
@@ -230,6 +230,7 @@ CPath::CPath(const wxString& filename)
}
wxCharBuffer fn = filename2char(filename);
+ // add fn.length() for wx 3.x
if (fn.data()) {
// Filename is valid in the current locale. This means that
// it either originated from a (wx)system-call, or from a