@@ -23,21 +23,25 @@ class MyProcess : public wxProcess
2323 : wxProcess(parent)
2424 , m_parent(parent)
2525 {
26- if (m_parent) { m_parent->m_myProcesses .push_back (this ); }
26+ if (m_parent) {
27+ m_parent->m_myProcesses .push_back (this );
28+ }
2729 }
2830
2931 virtual ~MyProcess () { m_parent = NULL ; }
3032 void OnTerminate (int pid, int status)
3133 {
32- if (m_parent) {
34+ if (m_parent) {
3335 clCommandEvent terminateEvent (wxEVT_TERMINAL_COMMAND_EXIT);
3436 m_parent->AddPendingEvent (terminateEvent);
3537 m_parent->m_pid = wxNOT_FOUND;
3638
37- std::list<wxProcess*>::iterator iter =
38- std::find_if (m_parent->m_myProcesses .begin (), m_parent->m_myProcesses .end (),
39- [&](wxProcess* proc) { return proc == this ; });
40- if (iter != m_parent->m_myProcesses .end ()) { m_parent->m_myProcesses .erase (iter); }
39+ std::list<wxProcess*>::iterator iter = std::find_if (m_parent->m_myProcesses .begin (),
40+ m_parent->m_myProcesses .end (),
41+ [&](wxProcess* proc) { return proc == this ; });
42+ if (iter != m_parent->m_myProcesses .end ()) {
43+ m_parent->m_myProcesses .erase (iter);
44+ }
4145 delete this ;
4246 }
4347 }
@@ -61,8 +65,11 @@ TerminalEmulator::~TerminalEmulator()
6165 }
6266}
6367
64- bool TerminalEmulator::ExecuteConsole (const wxString& command, bool waitOnExit, const wxString& command_args,
65- const wxString& workingDirectory, const wxString& title)
68+ bool TerminalEmulator::ExecuteConsole (const wxString& command,
69+ bool waitOnExit,
70+ const wxString& command_args,
71+ const wxString& workingDirectory,
72+ const wxString& title)
6673{
6774 wxUnusedVar (title);
6875 clConsoleBase::Ptr_t console = clConsoleBase::GetTerminal ();
@@ -72,7 +79,7 @@ bool TerminalEmulator::ExecuteConsole(const wxString& command, bool waitOnExit,
7279 console->SetCallback (new MyProcess (this ));
7380
7481 wxString strTitle = title;
75- if (strTitle.IsEmpty ()) {
82+ if (strTitle.IsEmpty ()) {
7683 strTitle << " '" << command << " '" ;
7784 } else {
7885 strTitle.Prepend (" '" ).Append (" '" );
@@ -94,9 +101,11 @@ void TerminalEmulator::OnProcessTerminated(clProcessEvent& event)
94101
95102void TerminalEmulator::Terminate ()
96103{
97- if (IsRunning ()) {
98- if (m_process) { m_process->Terminate (); }
99- if (m_pid != wxNOT_FOUND) {
104+ if (IsRunning ()) {
105+ if (m_process) {
106+ m_process->Terminate ();
107+ }
108+ if (m_pid != wxNOT_FOUND) {
100109 wxKill (m_pid, wxSIGKILL, NULL , wxKILL_CHILDREN);
101110 m_pid = wxNOT_FOUND;
102111 }
@@ -114,15 +123,17 @@ void TerminalEmulator::OnProcessOutput(clProcessEvent& event)
114123
115124bool TerminalEmulator::ExecuteNoConsole (const wxString& commandToRun, const wxString& workingDirectory)
116125{
117- if (m_process) {
126+ if (m_process) {
118127 // another process is running
119128 return false ;
120129 }
121130
122131 wxString command;
123132#ifdef __WXMSW__
124133 wxString shell = wxGetenv (" COMSPEC" );
125- if (shell.IsEmpty ()) { shell = " CMD" ; }
134+ if (shell.IsEmpty ()) {
135+ shell = " CMD" ;
136+ }
126137
127138 command << shell << wxT (" /c \" " );
128139 command << commandToRun << wxT (" \" " );
0 commit comments