mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-19 00:02:08 +08:00
b263a8d934
old-commit-hash: 140e6248e26cfa370ccdb13fda8edc4fae0321ca
14 lines
508 B
C++
14 lines
508 B
C++
#include "request_repeater.hpp"
|
|
|
|
RequestRepeater::RequestRepeater(QObject *parent, 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);
|
|
}
|