fix qt part schouldn't change before add algo)

This commit is contained in:
Rémi Heredero 2023-10-18 17:08:56 +02:00
parent e302dab670
commit a86d9b1dfc
2 changed files with 1 additions and 10 deletions

View File

@ -2,6 +2,7 @@
XFTimeout::XFTimeout(int id, int interval, interface::XFBehavior *pBehavior): XFTimeout::XFTimeout(int id, int interval, interface::XFBehavior *pBehavior):
XFEvent(XFEventType::Timeout, id), interval_(interval) { XFEvent(XFEventType::Timeout, id), interval_(interval) {
this->setRelTicks(this->getInterval());
setBehavior(pBehavior); setBehavior(pBehavior);
} }

View File

@ -34,16 +34,6 @@ XFTimeoutManager::~XFTimeoutManager() {
void XFTimeoutManager::addTimeout(XFTimeout *pNewTimeout) { 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->pMutex_->lock();
this->timeouts_.push_back(pNewTimeout); this->timeouts_.push_back(pNewTimeout);
this->pMutex_->unlock(); this->pMutex_->unlock();