]> git.lyx.org Git - lyx.git/blobdiff - src/support/forkedcontr.C
another safety belt
[lyx.git] / src / support / forkedcontr.C
index c00db4f5fe4a1bdcc2d880a97053c3943ad59b2a..d5f5d3eacf0c746ba24f1766319a928e75702a83 100644 (file)
@@ -1,11 +1,13 @@
 /**
  * \file forkedcontr.C
- * Copyright 2001 The LyX Team
- * Read COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
  * \author Asger Alstrup Nielsen
  * \author Angus Leeming
  *
+ * Full author contact details are available in file CREDITS
+ *
  * 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>
@@ -48,7 +53,7 @@ ForkedcallsController::ForkedcallsController()
        timeout_ = new Timeout(100, Timeout::ONETIME);
 
        timeout_->timeout
-               .connect(SigC::slot(this, &ForkedcallsController::timer));
+               .connect(boost::bind(&ForkedcallsController::timer, this));
 }
 
 
@@ -66,15 +71,13 @@ ForkedcallsController::~ForkedcallsController()
 }
 
 
-// Add child process information to the list of controlled processes
-void ForkedcallsController::addCall(Forkedcall const &newcall)
+void ForkedcallsController::addCall(ForkedProcess const & newcall)
 {
        if (!timeout_->running())
                timeout_->start();
 
-       Forkedcall * call = new Forkedcall(newcall);
-       forkedCalls.push_back(call);
-       childrenChanged.emit();
+       forkedCalls.push_back(newcall.clone());
+       childrenChanged();
 }
 
 
@@ -86,7 +89,7 @@ void ForkedcallsController::timer()
 
        for (ListType::iterator it = forkedCalls.begin();
             it != forkedCalls.end(); ++it) {
-               Forkedcall * actCall = *it;
+               ForkedProcess * actCall = *it;
 
                pid_t pid = actCall->pid();
                int stat_loc;
@@ -148,7 +151,7 @@ void ForkedcallsController::timer()
        }
 
        if (start_size != forkedCalls.size())
-               childrenChanged.emit();
+               childrenChanged();
 }