From d4c54a1da34fc8affec47b7280acfa985066a22c Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Mon, 22 Mar 2004 14:10:20 +0000 Subject: [PATCH] Remove cruft left over from the removal of the Forks dialog. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8511 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/support/ChangeLog | 5 +++++ src/support/forkedcontr.C | 42 --------------------------------------- src/support/forkedcontr.h | 39 ++++++++++-------------------------- 3 files changed, 15 insertions(+), 71 deletions(-) diff --git a/src/support/ChangeLog b/src/support/ChangeLog index 5a25694d3e..d5f2c1d155 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,8 @@ +2004-03-22 Angus Leeming + + * forkedcontr.[Ch] (childrenChanged, getPIDs, getCommand): remove + cruft left over from the removal of the Forks dialog. + 2004-03-09 Georg Baum * filename.[Ch] (mangledFilename): make sure that mangled names are diff --git a/src/support/forkedcontr.C b/src/support/forkedcontr.C index 3795ec1925..5124453e21 100644 --- a/src/support/forkedcontr.C +++ b/src/support/forkedcontr.C @@ -34,7 +34,6 @@ using boost::bind; using std::endl; using std::find_if; using std::string; -using std::vector; #ifndef CXX_GLOBAL_CSTD using std::strerror; @@ -81,7 +80,6 @@ void ForkedcallsController::addCall(ForkedProcess const & newcall) timeout_->start(); forkedCalls.push_back(newcall.clone().release()); - childrenChanged(); } @@ -89,8 +87,6 @@ void ForkedcallsController::addCall(ForkedProcess const & newcall) // Check the list and, if there is a stopped child, emit the signal. void ForkedcallsController::timer() { - ListType::size_type start_size = forkedCalls.size(); - ListType::iterator it = forkedCalls.begin(); ListType::iterator end = forkedCalls.end(); while (it != end) { @@ -155,44 +151,6 @@ void ForkedcallsController::timer() if (!forkedCalls.empty() && !timeout_->running()) { timeout_->start(); } - - if (start_size != forkedCalls.size()) - childrenChanged(); -} - - -// Return a vector of the pids of all the controlled processes. -vector const ForkedcallsController::getPIDs() const -{ - vector pids; - - if (forkedCalls.empty()) - return pids; - - pids.resize(forkedCalls.size()); - - vector::iterator vit = pids.begin(); - for (ListType::const_iterator lit = forkedCalls.begin(); - lit != forkedCalls.end(); ++lit, ++vit) { - *vit = (*lit)->pid(); - } - - std::sort(pids.begin(), pids.end()); - return pids; -} - - -// Get the command string of the process. -string const ForkedcallsController::getCommand(pid_t pid) const -{ - ListType::const_iterator it = - find_if(forkedCalls.begin(), forkedCalls.end(), - lyx::compare_memfun(&Forkedcall::pid, pid)); - - if (it == forkedCalls.end()) - return string(); - - return (*it)->command(); } diff --git a/src/support/forkedcontr.h b/src/support/forkedcontr.h index 58b7e33e16..ca02d23b02 100644 --- a/src/support/forkedcontr.h +++ b/src/support/forkedcontr.h @@ -16,13 +16,9 @@ #ifndef FORKEDCONTR_H #define FORKEDCONTR_H -#include -#include - #include // needed for pid_t #include -#include class Timeout; @@ -31,46 +27,31 @@ namespace support { class ForkedProcess; -class ForkedcallsController : public boost::signals::trackable { +class ForkedcallsController { public: - /// We need this to avoid warnings. - ForkedcallsController(); - /** This d-tor should really be private, but making it public - * allows egcs 1.1 to compile the class. - */ - ~ForkedcallsController(); - /// Get hold of the only controller that can exist inside the process. static ForkedcallsController & get(); /// Add a new child process to the list of controlled processes. void addCall(ForkedProcess const &); - /** This method is connected to the timer. Every XX ms it is called - * so that we can check on the status of the children. Those that - * are found to have finished are removed from the list and their - * callback function is passed the final return state. - */ - void timer(); - - /// Return a vector of the pids of all the controlled processes. - std::vector const getPIDs() const; - - /// Get the command string of the process. - std::string const getCommand(pid_t) const; - /** Kill this process prematurely and remove it from the list. * The process is killed within tolerance secs. * See forkedcall.[Ch] for details. */ void kill(pid_t, int tolerance = 5); - /// Signal emitted when the list of current child processes changes. - boost::signal0 childrenChanged; - private: - /// + ForkedcallsController(); ForkedcallsController(ForkedcallsController const &); + ~ForkedcallsController(); + + /** This method is connected to the timer. Every XX ms it is called + * so that we can check on the status of the children. Those that + * are found to have finished are removed from the list and their + * callback function is passed the final return state. + */ + void timer(); /// The child processes typedef std::list ListType; -- 2.39.5