Project

General

Profile

Bug #6576 ยป bug_6576.patch

Roel Standaert, 08/29/2018 02:29 PM

View differences:

src/Wt/WTimer.C
*/
#include "Wt/WApplication"
#include "Wt/WEnvironment"
#include "Wt/WTimer"
#include "Wt/WTimerWidget"
#include "Wt/WContainerWidget"
......
void WTimer::start()
{
WApplication *app = WApplication::instance();
if (!active_) {
WApplication *app = WApplication::instance();
if (app && app->timerRoot())
app->timerRoot()->addWidget(timerWidget_);
}
......
active_ = true;
*timeout_ = Time() + interval_;
bool jsRepeat = !singleShot_ &&
((app && app->environment().ajax()) ||
!timeout().isExposedSignal());
bool jsRepeat = !timeout().isExposedSignal() && !singleShot_;
timerWidget_->timerStart(jsRepeat);
......
if (active_) {
if (!singleShot_) {
*timeout_ = Time() + interval_;
if (!timerWidget_->jsRepeat()) {
WApplication *app = WApplication::instance();
timerWidget_->timerStart(app->environment().ajax());
}
timerWidget_->timerStart(false);
} else
stop();
}
src/Wt/WTimerWidget
void timerStart(bool jsRepeat);
bool timerExpired();
bool jsRepeat() const { return jsRepeat_; }
private:
WTimer *timer_;
bool timerStarted_;
    (1-1/1)