X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2FTimeout.C;h=99ee026f82cbed1be3686c35fdcd1eb329b17cc2;hb=36945644e70db39a8316570bb44fabc7a3bd3d49;hp=2ecb0442dffb971cef7770007ac7a7884929bb93;hpb=99d1627a471b92f403598d03dfc861ddc3c11be0;p=lyx.git diff --git a/src/frontends/Timeout.C b/src/frontends/Timeout.C index 2ecb0442df..99ee026f82 100644 --- a/src/frontends/Timeout.C +++ b/src/frontends/Timeout.C @@ -6,28 +6,17 @@ * \author Lars Gullik Bjønnes * \author John Levon * - * Full author contact details are available in file CREDITS + * Full author contact details are available in file CREDITS. */ #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_; } @@ -42,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(); @@ -61,6 +53,7 @@ void Timeout::emit() pimpl_->start(); } + Timeout & Timeout::setType(Type t) { type = t; @@ -70,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; }