Skip to content

Commit c82a362

Browse files
committed
remove wxCHECK_VERSION no longer necessary
and more useless code, because now wxWidgets 3.2 is required
1 parent 9693960 commit c82a362

27 files changed

+23
-1193
lines changed

src/CFile.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,6 @@ char* mktemp( char * path ) { return path ;}
8787
# define O_BINARY (0)
8888
#endif //__UNIX__
8989

90-
#if defined(__WINDOWS__) && !wxCHECK_VERSION(3, 1, 0)
91-
#include <wx/msw/mslu.h>
92-
#endif
93-
9490

9591
// The following defines handle different names across platforms,
9692
// and ensures that we use 64b IO on windows (only 32b by default).

src/ExternalConnector.cpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -665,31 +665,6 @@ wxString CaMuleExternalConnector::SetLocale(const wxString& language)
665665
return m_locale == NULL ? wxString() : m_locale->GetCanonicalName();
666666
}
667667

668-
#if !wxUSE_GUI && defined(__WXMAC__) && !wxCHECK_VERSION(2, 9, 0)
669-
670-
#include <wx/apptrait.h> // Do_not_auto_remove
671-
#include <wx/stdpaths.h> // Do_not_auto_remove
672-
673-
class CaMuleExternalConnectorTraits : public wxConsoleAppTraits
674-
{
675-
public:
676-
virtual wxStandardPathsBase& GetStandardPaths()
677-
{
678-
return s_stdPaths;
679-
}
680-
681-
private:
682-
static wxStandardPathsCF s_stdPaths;
683-
};
684-
685-
wxStandardPathsCF CaMuleExternalConnectorTraits::s_stdPaths;
686-
687-
wxAppTraits* CaMuleExternalConnector::CreateTraits()
688-
{
689-
return new CaMuleExternalConnectorTraits;
690-
}
691-
692-
#endif
693668

694669
#if wxUSE_ON_FATAL_EXCEPTION
695670
// Gracefully handle fatal exceptions and print backtrace if possible

src/ExternalConnector.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,6 @@ class CaMuleExternalConnector : public wxApp
179179
CCommandTree m_commands;
180180
const char * m_appname;
181181

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

186183
private:
187184
wxString m_configFileName;

src/Logger.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ CLoggerTarget::CLoggerTarget()
307307
{
308308
}
309309

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

327326
recursion = false;
328327
}
329-
#else
330-
void CLoggerTarget::DoLogString(const wxChar* msg, time_t)
331-
{
332-
// prevent infinite recursion
333-
static bool recursion = false;
334-
if (recursion) {
335-
return;
336-
}
337-
recursion = true;
338-
339-
wxCHECK_RET(msg, wxT("Log message is NULL in DoLogString!"));
340-
341-
wxString str(msg);
342-
343-
// This is much simpler than manually handling all wx log-types.
344-
// cppcheck-suppress duplicateBranch
345-
if (str.StartsWith(_("ERROR: ")) || str.StartsWith(_("WARNING: "))) {
346-
AddLogLineC(str);
347-
} else {
348-
AddLogLineN(str);
349-
}
350-
351-
recursion = false;
352-
}
353-
#endif
354328

355329
CLoggerAccess::CLoggerAccess()
356330
{

src/Logger.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -320,13 +320,9 @@ class CLoggerTarget : public wxLog
320320
CLoggerTarget();
321321

322322
/**
323-
* @see wxLog::DoLogString
323+
* @see wxLog::DoLogText
324324
*/
325-
#if wxCHECK_VERSION(2, 9, 0)
326325
void DoLogText(const wxString &msg);
327-
#else
328-
void DoLogString(const wxChar *msg, time_t);
329-
#endif
330326
};
331327

332328

src/MuleGifCtrl.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,7 @@ void MuleGifCtrl::Start()
116116
if (m_decoder && m_decoder->IsAnimation()) {
117117
m_timer.Stop();
118118
m_decoder->GoLastFrame();
119-
#if wxCHECK_VERSION(2, 9, 0)
120119
wxTimerEvent evt(m_timer);
121-
#else
122-
wxTimerEvent evt;
123-
#endif
124120
OnTimer(evt);
125121
}
126122
}

src/OtherFunctions.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,10 +1090,6 @@ wxString GetConfigDir(const wxString &configFileBase)
10901090
void InitCustomLanguages()
10911091
{
10921092
wxLanguageInfo info;
1093-
1094-
#if !wxCHECK_VERSION(2, 9, 0)
1095-
CUSTOMLANGUAGE(wxLANGUAGE_ASTURIAN, "ast", 0, 0, wxLayout_LeftToRight, "Asturian");
1096-
#endif
10971093
}
10981094

10991095

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

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

11141104
locale.AddCatalog(wxT(PACKAGE));

src/OtherFunctions.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,6 @@ inline long int make_full_ed2k_version(int a, int b, int c) {
338338

339339
wxString GetConfigDir(const wxString &configFile);
340340

341-
#if !wxCHECK_VERSION(2, 9, 0)
342-
enum {
343-
wxLANGUAGE_ASTURIAN = wxLANGUAGE_USER_DEFINED + 1
344-
};
345-
#endif
346341

347342
/**
348343
* Adds aMule's custom languages to db.

src/PartFile.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@
3636

3737
#include <wx/utils.h>
3838
#include <wx/tokenzr.h> // Needed for wxStringTokenizer
39-
#if wxCHECK_VERSION(2,9,0)
39+
4040
#ifndef AMULE_DAEMON
4141
#include <wx/notifmsg.h> // Needed for wxNotificationMessage
4242
#endif
43-
#endif
4443

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

21662165
AddLogLineC(CFormat( _("Finished downloading: %s") ) % GetFileName() );
2167-
#if wxCHECK_VERSION(2,9,0)
21682166
#ifndef AMULE_DAEMON
21692167
if (thePrefs::ShowNotifications()) {
21702168
wxNotificationMessage *notification = new wxNotificationMessage ();
@@ -2174,7 +2172,6 @@ void CPartFile::CompleteFileEnded(bool errorOccured, const CPath& newname)
21742172
notification->Show(7);
21752173
delete notification;
21762174
}
2177-
#endif
21782175
#endif
21792176
}
21802177

src/PrefsUnifiedDlg.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -511,11 +511,6 @@ bool PrefsUnifiedDlg::TransferToWindow()
511511
FindWindow(IDC_WEBUPNPTCPPORTTEXT)->Enable(thePrefs::GetUPnPWebServerEnabled());
512512
#endif
513513

514-
#if !wxCHECK_VERSION(2,9,0)
515-
CastChild(IDC_NOTIF, wxCheckBox)->SetValue(false);
516-
FindWindow(IDC_NOTIF)->Enable(false);
517-
#endif
518-
519514
#ifdef __DEBUG__
520515
// Set debugging toggles
521516
int count = theLogger.GetDebugCategoryCount();

src/amule.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,7 @@
9090
#ifndef AMULE_DAEMON
9191
#ifdef __WXMAC__
9292
#include <CoreFoundation/CFBundle.h> // Do_not_auto_remove
93-
#if wxCHECK_VERSION(2, 9, 0)
94-
#include <wx/osx/core/cfstring.h> // Do_not_auto_remove
95-
#else
96-
#include <wx/mac/corefoundation/cfstring.h> // Do_not_auto_remove
97-
#endif
93+
#include <wx/osx/core/cfstring.h> // Do_not_auto_remove
9894
#endif
9995
#include <wx/msgdlg.h>
10096

@@ -628,11 +624,7 @@ bool CamuleApp::OnInit()
628624
if (absoluteUrl) {
629625
CFStringRef amulewebCfstr = CFURLCopyFileSystemPath(absoluteUrl, kCFURLPOSIXPathStyle);
630626
CFRelease(absoluteUrl);
631-
#if wxCHECK_VERSION(2, 9, 0)
632627
amulewebPath = wxCFStringRef(amulewebCfstr).AsString(wxLocale::GetSystemEncoding());
633-
#else
634-
amulewebPath = wxMacCFStringHolder(amulewebCfstr).AsString(wxLocale::GetSystemEncoding());
635-
#endif
636628
}
637629
}
638630
#endif

src/amule.h

Lines changed: 0 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -431,116 +431,10 @@ extern CamuleGuiApp *theApp;
431431

432432
#else /* ! AMULE_DAEMON */
433433

434-
// wxWidgets 2.8 requires special code for event handling and sockets.
435-
// 2.9 doesn't, so standard event loop and sockets can be used
436-
//
437-
// Windows: aMuled compiles with 2.8 (without the special code),
438-
// but works only with 2.9
439-
440-
#if !wxCHECK_VERSION(2, 9, 0)
441-
// wx 2.8 needs a hand-made event loop in any case
442-
#define AMULED28_EVENTLOOP
443-
444-
#ifndef ASIO_SOCKETS
445-
// MSW: can't run amuled with 2.8 without ASIO sockets, just get it compiled
446-
#ifndef __WINDOWS__
447-
#define AMULED28_SOCKETS
448-
#endif
449-
#endif
450-
#endif
451-
452-
#ifdef AMULED28_SOCKETS
453-
#include <wx/socket.h>
454-
455-
class CSocketSet;
456-
457-
458-
class CAmuledGSocketFuncTable : public GSocketGUIFunctionsTable
459-
{
460-
private:
461-
CSocketSet *m_in_set, *m_out_set;
462-
463-
wxMutex m_lock;
464-
public:
465-
CAmuledGSocketFuncTable();
466-
467-
void AddSocket(GSocket *socket, GSocketEvent event);
468-
void RemoveSocket(GSocket *socket, GSocketEvent event);
469-
void RunSelect();
470-
471-
virtual bool OnInit();
472-
virtual void OnExit();
473-
virtual bool CanUseEventLoop();
474-
virtual bool Init_Socket(GSocket *socket);
475-
virtual void Destroy_Socket(GSocket *socket);
476-
virtual void Install_Callback(GSocket *socket, GSocketEvent event);
477-
virtual void Uninstall_Callback(GSocket *socket, GSocketEvent event);
478-
virtual void Enable_Events(GSocket *socket);
479-
virtual void Disable_Events(GSocket *socket);
480-
};
481-
482-
483-
#endif // AMULED28_SOCKETS
484-
485-
// AppTrait functionality is required for 2.8 wx sockets
486-
// Otherwise it's used to prevent zombie child processes,
487-
// which stops working with wx 2.9.5.
488-
// So disable it there (no idea if this has a noticeable impact).
489-
490-
#if !wxCHECK_VERSION(2, 9, 5) && !defined(__WINDOWS__)
491-
#define AMULED_APPTRAITS
492-
#endif
493-
494-
#ifdef AMULED_APPTRAITS
495-
496-
typedef std::map<int, class wxEndProcessData *> EndProcessDataMap;
497-
498-
#include <wx/apptrait.h>
499-
500-
class CDaemonAppTraits : public wxConsoleAppTraits
501-
{
502-
private:
503-
struct sigaction m_oldSignalChildAction;
504-
struct sigaction m_newSignalChildAction;
505-
506-
#ifdef AMULED28_SOCKETS
507-
CAmuledGSocketFuncTable *m_table;
508-
wxMutex m_lock;
509-
std::list<wxObject *> m_sched_delete;
510-
public:
511-
CDaemonAppTraits(CAmuledGSocketFuncTable *table);
512-
virtual GSocketGUIFunctionsTable* GetSocketGUIFunctionsTable();
513-
virtual void ScheduleForDestroy(wxObject *object);
514-
virtual void RemoveFromPendingDelete(wxObject *object);
515-
516-
void DeletePending();
517-
#else // AMULED28_SOCKETS
518-
public:
519-
CDaemonAppTraits();
520-
#endif // !AMULED28_SOCKETS
521-
522-
virtual int WaitForChild(wxExecuteData& execData);
523-
524-
#if defined(__WXMAC__) && !wxCHECK_VERSION(2, 9, 0)
525-
virtual wxStandardPathsBase& GetStandardPaths();
526-
#endif
527-
};
528-
529-
void OnSignalChildHandler(int signal, siginfo_t *siginfo, void *ucontext);
530-
pid_t AmuleWaitPid(pid_t pid, int *status, int options, wxString *msg);
531-
532-
#endif // AMULED_APPTRAITS
533-
534434

535435
class CamuleDaemonApp : public CamuleApp
536436
{
537437
private:
538-
#ifdef AMULED28_EVENTLOOP
539-
bool m_Exit;
540-
#endif
541-
#ifdef AMULED28_SOCKETS
542-
CAmuledGSocketFuncTable *m_table;
543-
#endif
544438
bool OnInit();
545439
int OnRun();
546440
int OnExit();
@@ -554,20 +448,7 @@ class CamuleDaemonApp : public CamuleApp
554448
// This function are overridden to perform this.
555449
virtual bool Initialize(int& argc_, wxChar **argv_);
556450

557-
#ifdef AMULED_APPTRAITS
558-
struct sigaction m_oldSignalChildAction;
559-
struct sigaction m_newSignalChildAction;
560451
public:
561-
wxAppTraits *CreateTraits();
562-
#endif // AMULED_APPTRAITS
563-
564-
public:
565-
566-
#ifdef AMULED28_EVENTLOOP
567-
CamuleDaemonApp();
568-
569-
void ExitMainLoop() { m_Exit = true; }
570-
#endif
571452

572453
bool CopyTextToClipboard(wxString strText);
573454

0 commit comments

Comments
 (0)