]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/Timeout.C
namespace grfx -> lyx::graphics
[lyx.git] / src / frontends / Timeout.C
index 2ecb0442dffb971cef7770007ac7a7884929bb93..9d7052fe548e9ed7e6a353ae26b613e3c1e96734 100644 (file)
 #include <config.h>
 
 #include "Timeout.h"
-#include "debug.h"
+#include "support/LAssert.h"
 
-#include "Timeout_pimpl.h"
-
-
-Timeout::Timeout(unsigned int msec, Type t)
-       : type(t), timeout_ms(msec)
-{
-       pimpl_ = new Pimpl(this);
-}
+using namespace lyx::support;
 
 
 Timeout::~Timeout()
 {
        pimpl_->stop();
-       delete pimpl_;
 }
 
 
@@ -42,17 +34,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 +56,7 @@ void Timeout::emit()
                pimpl_->start();
 }
 
+
 Timeout & Timeout::setType(Type t)
 {
        type = t;
@@ -70,6 +66,9 @@ Timeout & Timeout::setType(Type t)
 
 Timeout & Timeout::setTimeout(unsigned int msec)
 {
+       // Can't have a timeout of zero!
+       Assert(msec);
+
        timeout_ms = msec;
        return * this;
 }