mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +08:00
refs #687, further performance improvements
* avoid redundant reads by excluding entities which will be periodically updated * restart timers when data are received, avoid overlapping requests
This commit is contained in:
@@ -98,6 +98,15 @@ namespace BlackCore
|
||||
});
|
||||
}
|
||||
|
||||
void CThreadedReader::restartTimer(bool onlyWhenActive)
|
||||
{
|
||||
const int intervalMs(this->interval());
|
||||
if (!onlyWhenActive || this->isTimerActive())
|
||||
{
|
||||
this->setInterval(intervalMs);
|
||||
}
|
||||
}
|
||||
|
||||
bool CThreadedReader::didContentChange(const QString &content, int startPosition)
|
||||
{
|
||||
uint oldHash = 0;
|
||||
@@ -126,6 +135,12 @@ namespace BlackCore
|
||||
return this->m_updateTimer->interval();
|
||||
}
|
||||
|
||||
bool CThreadedReader::isTimerActive() const
|
||||
{
|
||||
QReadLocker rl(&this->m_lock);
|
||||
return this->m_updateTimer->isActive();
|
||||
}
|
||||
|
||||
void CThreadedReader::setIntervalFromSettingsAndStart()
|
||||
{
|
||||
this->setInitialTime();
|
||||
|
||||
Reference in New Issue
Block a user