mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 13:46:43 +00:00
0c5c06c8c4
All still VERY primitive, in fact even more primitive since some stuff got re-horked after the meeting, and still needs working on. Won't actually compile out of the box, but the tweaks should be pretty obvious for any body sufficiently daring. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4427 a592a061-630c-0410-9148-cb99ea01b6c8
58 lines
736 B
C
58 lines
736 B
C
/**
|
|
* \file qt2/Timeout_pimpl.C
|
|
* Copyright 2001 LyX Team
|
|
* Read COPYING
|
|
*
|
|
* \author John Levon
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
#ifdef __GNUG__
|
|
#pragma implementation
|
|
#endif
|
|
|
|
#include "Timeout_pimpl.h"
|
|
#include "debug.h"
|
|
|
|
using std::endl;
|
|
|
|
Timeout::Pimpl::Pimpl(Timeout * owner)
|
|
: owner_(owner), timeout_id(-1)
|
|
{
|
|
}
|
|
|
|
|
|
void Timeout::Pimpl::timerEvent(QTimerEvent *)
|
|
{
|
|
owner_->emit();
|
|
}
|
|
|
|
|
|
void Timeout::Pimpl::reset()
|
|
{
|
|
killTimers();
|
|
timeout_id = -1;
|
|
}
|
|
|
|
|
|
bool Timeout::Pimpl::running() const
|
|
{
|
|
return timeout_id != -1;
|
|
}
|
|
|
|
|
|
void Timeout::Pimpl::start()
|
|
{
|
|
if (running())
|
|
lyxerr << "Timeout::start: already running!" << endl;
|
|
timeout_id = startTimer(owner_->timeout_ms);
|
|
}
|
|
|
|
|
|
void Timeout::Pimpl::stop()
|
|
{
|
|
if (running())
|
|
reset();
|
|
}
|