Allow small timeout intervals in IdleInterface

A threshold exists to stop users flooding the server for no reason.

However, there is a usecase for small timeouts.

rsibreak has a "please relax for 20 seconds" interface. Here it makes
perfect sense to know if a user is active in small increments. The plan
is to start a 1s timer and wait for that. Then we wait locally for 20s
without a resume event.
This commit is contained in:
David Edmundson 2020-11-16 15:30:50 +00:00
parent 02dd1d45a5
commit f91271b29e

View file

@ -144,8 +144,8 @@ void IdleTimeoutInterface::setup(quint32 timeout)
}
timer = new QTimer(this);
timer->setSingleShot(true);
// less than 5 sec is not idle by definition
timer->setInterval(qMax(timeout, 5000u));
// less than 500 msec is not idle by definition
timer->setInterval(qMax(timeout, 500u));
QObject::connect(timer, &QTimer::timeout, this,
[this] {
send_idle();