]> git.saurik.com Git - wxWidgets.git/commitdiff
get rid of traits functions unnecessary now that wxExecute() works in both base and...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 22 Mar 2008 14:15:28 +0000 (14:15 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 22 Mar 2008 14:15:28 +0000 (14:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52693 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/unix/apptbase.h
src/unix/utilsunx.cpp

index c1015702017517a3bb6bf60ad796336aa022e3d6..0f774523908d6d644993afb40520acdb60f5a266 100644 (file)
@@ -26,20 +26,6 @@ public:
     // wxExecute() support methods
     // ---------------------------
 
-    // called before starting the child process and creates the pipe used for
-    // detecting the process termination asynchronously in GUI, does nothing in
-    // wxBase
-    //
-    // if it returns false, we should return from wxExecute() with an error
-    virtual bool CreateEndProcessPipe(wxExecuteData& execData);
-
-    // test if the given descriptor is the end of the pipe create by the
-    // function above
-    virtual bool IsWriteFDOfEndProcessPipe(wxExecuteData& execData, int fd);
-
-    // ensure that the write end of the pipe is not closed by wxPipe dtor
-    virtual void DetachWriteFDOfEndProcessPipe(wxExecuteData& execData);
-
     // wait for the process termination, return whatever wxExecute() must
     // return
     //
index 131aac407ce1621e50ab691ec256d80e740860f7..305c194cf7eb88d777b48dbe9e7cbaff16c5202e 100644 (file)
@@ -516,7 +516,7 @@ long wxExecute(wxChar **argv, int flags, wxProcess *process)
     execData.process = process;
 
     // create pipes
-    if ( !traits->CreateEndProcessPipe(execData) )
+    if ( !execData.pipeEndProcDetect.Create() )
     {
         wxLogError( _("Failed to execute '%s'\n"), *argv );
 
@@ -576,7 +576,7 @@ long wxExecute(wxChar **argv, int flags, wxProcess *process)
                 if ( fd == pipeIn[wxPipe::Read]
                         || fd == pipeOut[wxPipe::Write]
                         || fd == pipeErr[wxPipe::Write]
-                        || traits->IsWriteFDOfEndProcessPipe(execData, fd) )
+                        || fd == (execData.pipeEndProcDetect)[wxPipe::Write] )
                 {
                     // don't close this one, we still need it
                     continue;
@@ -598,8 +598,10 @@ long wxExecute(wxChar **argv, int flags, wxProcess *process)
 #endif // !__VMS
 
         // reading side can be safely closed but we should keep the write one
-        // opened
-        traits->DetachWriteFDOfEndProcessPipe(execData);
+        // opened, it will be only closed when the process terminates resulting
+        // in a read notification to the parent
+        execData.pipeEndProcDetect.Detach(wxPipe::Write);
+        execData.pipeEndProcDetect.Close();
 
         // redirect stdin, stdout and stderr
         if ( pipeIn.IsOk() )
@@ -1225,22 +1227,6 @@ bool wxHandleFatalExceptions(bool doit)
 // wxExecute support
 // ----------------------------------------------------------------------------
 
-bool wxAppTraits::CreateEndProcessPipe(wxExecuteData& execData)
-{
-    return execData.pipeEndProcDetect.Create();
-}
-
-bool wxAppTraits::IsWriteFDOfEndProcessPipe(wxExecuteData& execData, int fd)
-{
-    return fd == (execData.pipeEndProcDetect)[wxPipe::Write];
-}
-
-void wxAppTraits::DetachWriteFDOfEndProcessPipe(wxExecuteData& execData)
-{
-    execData.pipeEndProcDetect.Detach(wxPipe::Write);
-    execData.pipeEndProcDetect.Close();
-}
-
 int wxAppTraits::AddProcessCallback(wxEndProcessData *data, int fd)
 {
     // define a custom handler processing only the closure of the descriptor