X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2FTimeout.C;h=99ee026f82cbed1be3686c35fdcd1eb329b17cc2;hb=2f1d525ee1d41bc20adbfe766a9c5d90469aa4b2;hp=60808d703891cadc0d8f32b612ffc64a7bf91ff1;hpb=1e394731004491d04abe436112b5a89521bbd19a;p=lyx.git diff --git a/src/frontends/Timeout.C b/src/frontends/Timeout.C index 60808d7038..99ee026f82 100644 --- a/src/frontends/Timeout.C +++ b/src/frontends/Timeout.C @@ -1,34 +1,22 @@ /** * \file Timeout.C - * Copyright 2001 LyX Team - * Read COPYING + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * * \author Lars Gullik Bjønnes * \author John Levon + * + * Full author contact details are available in file CREDITS. */ -#ifdef __GNUG__ -#pragma implementation -#endif #include #include "Timeout.h" -#include "debug.h" - -#include "Timeout_pimpl.h" - - -Timeout::Timeout(unsigned int msec, Type t) - : type(t), timeout_ms(msec) -{ - pimpl_ = new Pimpl(this); -} Timeout::~Timeout() { pimpl_->stop(); - delete pimpl_; } @@ -43,17 +31,20 @@ void Timeout::start() pimpl_->start(); } + void Timeout::stop() { pimpl_->stop(); } + void Timeout::restart() { pimpl_->stop(); pimpl_->start(); } + void Timeout::emit() { pimpl_->reset(); @@ -62,6 +53,7 @@ void Timeout::emit() pimpl_->start(); } + Timeout & Timeout::setType(Type t) { type = t; @@ -71,6 +63,9 @@ Timeout & Timeout::setType(Type t) Timeout & Timeout::setTimeout(unsigned int msec) { + // Can't have a timeout of zero! + BOOST_ASSERT(msec); + timeout_ms = msec; return * this; }