mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-02-24 06:03:54 +08:00
14 lines
513 B
C++
14 lines
513 B
C++
#include "request_repeater.h"
|
|
|
|
RequestRepeater::RequestRepeater(QObject *parent, const QString &requestURL, const QString &cacheKey,
|
|
int period) : HttpRequest(parent, requestURL, cacheKey) {
|
|
timer = new QTimer(this);
|
|
timer->setTimerType(Qt::VeryCoarseTimer);
|
|
QObject::connect(timer, &QTimer::timeout, [=](){
|
|
if (!QUIState::ui_state.scene.started && QUIState::ui_state.awake && reply == NULL) {
|
|
sendRequest(requestURL);
|
|
}
|
|
});
|
|
timer->start(period * 1000);
|
|
}
|