Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/amule-project/amule
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanop committed Oct 13, 2024
2 parents 96d23dc + 4db7f84 commit f08e91a
Show file tree
Hide file tree
Showing 30 changed files with 631 additions and 1,854 deletions.
1,223 changes: 608 additions & 615 deletions po/nl.po

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions src/CFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ char* mktemp( char * path ) { return path ;}
# define O_BINARY (0)
#endif //__UNIX__

#if defined(__WINDOWS__) && !wxCHECK_VERSION(3, 1, 0)
#include <wx/msw/mslu.h>
#endif


// The following defines handle different names across platforms,
// and ensures that we use 64b IO on windows (only 32b by default).
Expand Down
25 changes: 0 additions & 25 deletions src/ExternalConnector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,31 +665,6 @@ wxString CaMuleExternalConnector::SetLocale(const wxString& language)
return m_locale == NULL ? wxString() : m_locale->GetCanonicalName();
}

#if !wxUSE_GUI && defined(__WXMAC__) && !wxCHECK_VERSION(2, 9, 0)

#include <wx/apptrait.h> // Do_not_auto_remove
#include <wx/stdpaths.h> // Do_not_auto_remove

class CaMuleExternalConnectorTraits : public wxConsoleAppTraits
{
public:
virtual wxStandardPathsBase& GetStandardPaths()
{
return s_stdPaths;
}

private:
static wxStandardPathsCF s_stdPaths;
};

wxStandardPathsCF CaMuleExternalConnectorTraits::s_stdPaths;

wxAppTraits* CaMuleExternalConnector::CreateTraits()
{
return new CaMuleExternalConnectorTraits;
}

#endif

#if wxUSE_ON_FATAL_EXCEPTION
// Gracefully handle fatal exceptions and print backtrace if possible
Expand Down
3 changes: 0 additions & 3 deletions src/ExternalConnector.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,6 @@ class CaMuleExternalConnector : public wxApp
CCommandTree m_commands;
const char * m_appname;

#if !wxUSE_GUI && defined(__WXMAC__) && !wxCHECK_VERSION(2, 9, 0)
virtual wxAppTraits* CreateTraits();
#endif

private:
wxString m_configFileName;
Expand Down
26 changes: 0 additions & 26 deletions src/Logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ CLoggerTarget::CLoggerTarget()
{
}

#if wxCHECK_VERSION(2, 9, 0)
void CLoggerTarget::DoLogText(const wxString &msg)
{
// prevent infinite recursion
Expand All @@ -326,31 +325,6 @@ void CLoggerTarget::DoLogText(const wxString &msg)

recursion = false;
}
#else
void CLoggerTarget::DoLogString(const wxChar* msg, time_t)
{
// prevent infinite recursion
static bool recursion = false;
if (recursion) {
return;
}
recursion = true;

wxCHECK_RET(msg, wxT("Log message is NULL in DoLogString!"));

wxString str(msg);

// This is much simpler than manually handling all wx log-types.
// cppcheck-suppress duplicateBranch
if (str.StartsWith(_("ERROR: ")) || str.StartsWith(_("WARNING: "))) {
AddLogLineC(str);
} else {
AddLogLineN(str);
}

recursion = false;
}
#endif

CLoggerAccess::CLoggerAccess()
{
Expand Down
6 changes: 1 addition & 5 deletions src/Logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,9 @@ class CLoggerTarget : public wxLog
CLoggerTarget();

/**
* @see wxLog::DoLogString
* @see wxLog::DoLogText
*/
#if wxCHECK_VERSION(2, 9, 0)
void DoLogText(const wxString &msg);
#else
void DoLogString(const wxChar *msg, time_t);
#endif
};


Expand Down
4 changes: 0 additions & 4 deletions src/MuleGifCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,7 @@ void MuleGifCtrl::Start()
if (m_decoder && m_decoder->IsAnimation()) {
m_timer.Stop();
m_decoder->GoLastFrame();
#if wxCHECK_VERSION(2, 9, 0)
wxTimerEvent evt(m_timer);
#else
wxTimerEvent evt;
#endif
OnTimer(evt);
}
}
Expand Down
26 changes: 0 additions & 26 deletions src/MuleNotebook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
DEFINE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MULENOTEBOOK_PAGE_CLOSING)
DEFINE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MULENOTEBOOK_ALL_PAGES_CLOSED)

#if MULE_NEEDS_DELETEPAGE_WORKAROUND
DEFINE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MULENOTEBOOK_DELETE_PAGE)
#endif

BEGIN_EVENT_TABLE(CMuleNotebook, wxNotebook)
EVT_RIGHT_DOWN(CMuleNotebook::OnRMButton)

Expand All @@ -50,9 +46,6 @@ BEGIN_EVENT_TABLE(CMuleNotebook, wxNotebook)
EVT_MIDDLE_DOWN(CMuleNotebook::OnMouseButton)
EVT_MIDDLE_UP(CMuleNotebook::OnMouseButton)
EVT_MOTION(CMuleNotebook::OnMouseMotion)
#if MULE_NEEDS_DELETEPAGE_WORKAROUND
EVT_MULENOTEBOOK_DELETE_PAGE(wxID_ANY, CMuleNotebook::OnDeletePage)
#endif
END_EVENT_TABLE()


Expand All @@ -71,15 +64,6 @@ CMuleNotebook::~CMuleNotebook()
}


#if MULE_NEEDS_DELETEPAGE_WORKAROUND
void CMuleNotebook::OnDeletePage(wxBookCtrlEvent& evt)
{
int page = evt.GetSelection();
DeletePage(page);
}
#endif // MULE_NEEDS_DELETEPAGE_WORKAROUND


bool CMuleNotebook::DeletePage(int nPage)
{
wxCHECK_MSG((nPage >= 0) && (nPage < (int)GetPageCount()), false,
Expand Down Expand Up @@ -249,17 +233,7 @@ void CMuleNotebook::OnMouseButton(wxMouseEvent &event)
// User did click on a 'x' or middle click on the label
tab_down_icon = -1;
tab_down_label = -1;
#if MULE_NEEDS_DELETEPAGE_WORKAROUND
/* WORKAROUND: Instead of calling DeletePage, we need to wait for the
* mouse release signal to reach Gtk. Inconsistent with normal wxEvent
* behaviour the button release handler in wxWidgets don't evaluate
* the result of the signal handling. */
wxNotebookEvent evt( wxEVT_COMMAND_MULENOTEBOOK_DELETE_PAGE, GetId(), tab );
evt.SetEventObject(this);
AddPendingEvent( evt );
#else
DeletePage(tab);
#endif // MULE_NEEDS_DELETEPAGE_WORKAROUND
} else {
// Is not a 'x'. Send this event up.
event.Skip();
Expand Down
20 changes: 0 additions & 20 deletions src/MuleNotebook.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,10 @@

#include <wx/notebook.h>

#define MULE_NEEDS_DELETEPAGE_WORKAROUND wxCHECK_VERSION(3,0,2)


DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MULENOTEBOOK_PAGE_CLOSING, -1)
DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MULENOTEBOOK_ALL_PAGES_CLOSED, -1)

#if MULE_NEEDS_DELETEPAGE_WORKAROUND
DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MULENOTEBOOK_DELETE_PAGE, -1)

#define EVT_MULENOTEBOOK_DELETE_PAGE(id, fn) \
DECLARE_EVENT_TABLE_ENTRY( \
wxEVT_COMMAND_MULENOTEBOOK_DELETE_PAGE, \
id, \
-1, \
(wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
NULL \
),
#endif // MULE_NEEDS_DELETEPAGE_WORKAROUND

#define EVT_MULENOTEBOOK_PAGE_CLOSING(id, fn) \
DECLARE_EVENT_TABLE_ENTRY( \
Expand Down Expand Up @@ -122,12 +108,6 @@ class CMuleNotebook : public wxNotebook
*/
void SetPopupHandler( wxWindow* widget );

#if MULE_NEEDS_DELETEPAGE_WORKAROUND
private:
// Internal handler. Workaround for wxWidgets Tab-Crash bug.
void OnDeletePage(wxBookCtrlEvent& evt);
#endif // MULE_NEEDS_DELETEPAGE_WORKAROUND

protected:
/**
* Event handler for left or middle mouse button to press or release (for closing pages)
Expand Down
10 changes: 0 additions & 10 deletions src/OtherFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1090,10 +1090,6 @@ wxString GetConfigDir(const wxString &configFileBase)
void InitCustomLanguages()
{
wxLanguageInfo info;

#if !wxCHECK_VERSION(2, 9, 0)
CUSTOMLANGUAGE(wxLANGUAGE_ASTURIAN, "ast", 0, 0, wxLayout_LeftToRight, "Asturian");
#endif
}


Expand All @@ -1103,12 +1099,6 @@ void InitLocale(wxLocale& locale, int language)

#if defined(__WXMAC__) || defined(__WINDOWS__)
locale.AddCatalogLookupPathPrefix(JoinPaths(wxStandardPaths::Get().GetDataDir(), wxT("locale")));
#else
#if (wxCHECK_VERSION(2,9,5) && !wxCHECK_VERSION(3,0,3)) || (wxCHECK_VERSION(3,1,0) && !wxCHECK_VERSION(3,1,1))
// Add correct place to look for catalog files if we're using a wxWidgets version where it's broken
// See also http://trac.wxwidgets.org/ticket/17740
locale.AddCatalogLookupPathPrefix(JoinPaths(JoinPaths(wxStandardPaths::Get().GetInstallPrefix(), wxT("share")), wxT("locale")));
#endif /* wxCHECK_VERSION(2,9,5)... */
#endif /* (!)(defined(__WXMAC__) || defined(__WINDOWS__)) */

locale.AddCatalog(wxT(PACKAGE));
Expand Down
5 changes: 0 additions & 5 deletions src/OtherFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,6 @@ inline long int make_full_ed2k_version(int a, int b, int c) {

wxString GetConfigDir(const wxString &configFile);

#if !wxCHECK_VERSION(2, 9, 0)
enum {
wxLANGUAGE_ASTURIAN = wxLANGUAGE_USER_DEFINED + 1
};
#endif

/**
* Adds aMule's custom languages to db.
Expand Down
5 changes: 1 addition & 4 deletions src/PartFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@

#include <wx/utils.h>
#include <wx/tokenzr.h> // Needed for wxStringTokenizer
#if wxCHECK_VERSION(2,9,0)

#ifndef AMULE_DAEMON
#include <wx/notifmsg.h> // Needed for wxNotificationMessage
#endif
#endif

#include "KnownFileList.h" // Needed for CKnownFileList
#include "CanceledFileList.h"
Expand Down Expand Up @@ -2164,7 +2163,6 @@ void CPartFile::CompleteFileEnded(bool errorOccured, const CPath& newname)
m_CorruptionBlackBox->Free();

AddLogLineC(CFormat( _("Finished downloading: %s") ) % GetFileName() );
#if wxCHECK_VERSION(2,9,0)
#ifndef AMULE_DAEMON
if (thePrefs::ShowNotifications()) {
wxNotificationMessage *notification = new wxNotificationMessage ();
Expand All @@ -2174,7 +2172,6 @@ void CPartFile::CompleteFileEnded(bool errorOccured, const CPath& newname)
notification->Show(7);
delete notification;
}
#endif
#endif
}

Expand Down
5 changes: 0 additions & 5 deletions src/PrefsUnifiedDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,11 +511,6 @@ bool PrefsUnifiedDlg::TransferToWindow()
FindWindow(IDC_WEBUPNPTCPPORTTEXT)->Enable(thePrefs::GetUPnPWebServerEnabled());
#endif

#if !wxCHECK_VERSION(2,9,0)
CastChild(IDC_NOTIF, wxCheckBox)->SetValue(false);
FindWindow(IDC_NOTIF)->Enable(false);
#endif

#ifdef __DEBUG__
// Set debugging toggles
int count = theLogger.GetDebugCategoryCount();
Expand Down
10 changes: 1 addition & 9 deletions src/amule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,7 @@
#ifndef AMULE_DAEMON
#ifdef __WXMAC__
#include <CoreFoundation/CFBundle.h> // Do_not_auto_remove
#if wxCHECK_VERSION(2, 9, 0)
#include <wx/osx/core/cfstring.h> // Do_not_auto_remove
#else
#include <wx/mac/corefoundation/cfstring.h> // Do_not_auto_remove
#endif
#include <wx/osx/core/cfstring.h> // Do_not_auto_remove
#endif
#include <wx/msgdlg.h>

Expand Down Expand Up @@ -628,11 +624,7 @@ bool CamuleApp::OnInit()
if (absoluteUrl) {
CFStringRef amulewebCfstr = CFURLCopyFileSystemPath(absoluteUrl, kCFURLPOSIXPathStyle);
CFRelease(absoluteUrl);
#if wxCHECK_VERSION(2, 9, 0)
amulewebPath = wxCFStringRef(amulewebCfstr).AsString(wxLocale::GetSystemEncoding());
#else
amulewebPath = wxMacCFStringHolder(amulewebCfstr).AsString(wxLocale::GetSystemEncoding());
#endif
}
}
#endif
Expand Down
Loading

0 comments on commit f08e91a

Please sign in to comment.