mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-19 16:22:08 +08:00
ee9280d9d3
old-commit-hash: ad57cd37595919c84c7c8315222a1141d10993fa
14 lines
515 B
C++
14 lines
515 B
C++
#include "request_repeater.hpp"
|
|
|
|
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);
|
|
}
|