From 9ead6d4221d857f1786a5dee30e3631e9cea466e Mon Sep 17 00:00:00 2001 From: lllucius Date: Sun, 4 Jan 2015 21:18:37 +0000 Subject: [PATCH] Make the IPC classes wx3 compatible --- src/AudacityApp.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp index 454384b93..07a4953a6 100644 --- a/src/AudacityApp.cpp +++ b/src/AudacityApp.cpp @@ -586,10 +586,8 @@ public: { }; - bool OnExecute(const wxString & WXUNUSED(topic), - wxChar *data, - int WXUNUSED(size), - wxIPCFormat WXUNUSED(format)) + bool OnExec(const wxString & WXUNUSED(topic), + const wxString & data) { if (!gInited) { return false; @@ -597,13 +595,11 @@ public: AudacityProject *project = CreateNewAudacityProject(); - wxString cmd(data); - // We queue a command event to the project responsible for // opening the file since it can be a long process and we // only have 5 seconds to return the Execute message to the // client. - if (!cmd.IsEmpty()) { + if (!data.IsEmpty()) { wxCommandEvent e(EVT_OPEN_AUDIO_FILE); e.SetString(data); project->GetEventHandler()->AddPendingEvent(e); @@ -614,6 +610,16 @@ public: return true; } +#if !wxCHECK_VERSION(3, 0, 0) + bool OnExecute(const wxString & topic, + wxChar *data, + int WXUNUSED(size), + wxIPCFormat WXUNUSED(format)) + { + return OnExec(topic, data); + } +#endif + virtual bool OnDisconnect() { return true;