From a86d9b1dfc5101a7ff5c10a64111463fdf77a1d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Wed, 18 Oct 2023 17:08:56 +0200 Subject: [PATCH] fix qt part schouldn't change before add algo) --- src/simplified/xf/core/timeout.cpp | 1 + src/simplified/xf/port/common/timeoutmanager.cpp | 10 ---------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/simplified/xf/core/timeout.cpp b/src/simplified/xf/core/timeout.cpp index f2a6d89..f2e2037 100644 --- a/src/simplified/xf/core/timeout.cpp +++ b/src/simplified/xf/core/timeout.cpp @@ -2,6 +2,7 @@ XFTimeout::XFTimeout(int id, int interval, interface::XFBehavior *pBehavior): XFEvent(XFEventType::Timeout, id), interval_(interval) { + this->setRelTicks(this->getInterval()); setBehavior(pBehavior); } diff --git a/src/simplified/xf/port/common/timeoutmanager.cpp b/src/simplified/xf/port/common/timeoutmanager.cpp index f0d0e87..2c366fe 100644 --- a/src/simplified/xf/port/common/timeoutmanager.cpp +++ b/src/simplified/xf/port/common/timeoutmanager.cpp @@ -34,16 +34,6 @@ XFTimeoutManager::~XFTimeoutManager() { void XFTimeoutManager::addTimeout(XFTimeout *pNewTimeout) { - const int desireInterval = pNewTimeout->getInterval(); - - TimeoutList::iterator it; - do { - // TODO, super algorithm - } while (true); - - int ticks = pNewTimeout->getInterval() / this->tickInterval_; - pNewTimeout->setRelTicks(ticks); - this->pMutex_->lock(); this->timeouts_.push_back(pNewTimeout); this->pMutex_->unlock();