]> git.lyx.org Git - lyx.git/blobdiff - src/support/forkedcontr.C
remove NO_PEXTRA_STUFF
[lyx.git] / src / support / forkedcontr.C
index 13b397eb8887c5881fac7a27c0b70f38f62919bf..7df4e211c373c7849cb131924b4e9c07b68c908d 100644 (file)
@@ -6,7 +6,7 @@
  * \author Asger Alstrup Nielsen
  * \author Angus Leeming
  *
- * A class for the control of child processes launched using 
+ * A class for the control of child processes launched using
  * fork() and execvp().
  */
 
 #include "forkedcontr.h"
 #include "forkedcall.h"
 #include "lyxfunctional.h"
-#include "frontends/Timeout.h"
 #include "debug.h"
 
+#include "frontends/Timeout.h"
+
+#include <boost/bind.hpp>
+
 #include <cerrno>
 #include <cstdlib>
 #include <unistd.h>
@@ -45,10 +48,10 @@ ForkedcallsController & ForkedcallsController::get()
 
 ForkedcallsController::ForkedcallsController()
 {
-       timeout_ = new Timeout(100, Timeout::CONTINUOUS);
-       
+       timeout_ = new Timeout(100, Timeout::ONETIME);
+
        timeout_->timeout
-               .connect(SigC::slot(this, &ForkedcallsController::timer));
+               .connect(boost::bind(&ForkedcallsController::timer, this));
 }
 
 
@@ -74,7 +77,7 @@ void ForkedcallsController::addCall(Forkedcall const &newcall)
 
        Forkedcall * call = new Forkedcall(newcall);
        forkedCalls.push_back(call);
-       childrenChanged.emit();
+       childrenChanged();
 }
 
 
@@ -94,7 +97,7 @@ void ForkedcallsController::timer()
                bool remove_it = false;
 
                if (waitrpid == -1) {
-                       lyxerr << "LyX: Error waiting for child: " 
+                       lyxerr << "LyX: Error waiting for child: "
                               << strerror(errno) << endl;
 
                        // Child died, so pretend it returned 1
@@ -116,9 +119,9 @@ void ForkedcallsController::timer()
                        remove_it = true;
 
                } else if (WIFSTOPPED(stat_loc)) {
-                       lyxerr << "LyX: Child (pid: " << pid 
+                       lyxerr << "LyX: Child (pid: " << pid
                               << ") stopped on signal "
-                              << WSTOPSIG(stat_loc) 
+                              << WSTOPSIG(stat_loc)
                               << ". Waiting for child to finish." << endl;
 
                } else {
@@ -143,12 +146,12 @@ void ForkedcallsController::timer()
                }
        }
 
-       if (forkedCalls.empty()) {
-               timeout_->stop();
+       if (!forkedCalls.empty()) {
+               timeout_->start();
        }
 
        if (start_size != forkedCalls.size())
-               childrenChanged.emit();
+               childrenChanged();
 }