To avoid progress bar event flooding, adds a long-term timer to send the events periodically
Details
Details
- Reviewers
kfunk - Group Reviewers
KDevelop - Commits
- R32:77e98b914694: Periodically update progress bar
R33:77e98b914694: Periodically update progress bar
Diff Detail
Diff Detail
- Repository
- R33 KDevPlatform
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
language/backgroundparser/backgroundparser.cpp | ||
---|---|---|
210 | There must be a different way to implement this feature, a constantly running timer is not good style. Maybe start/resume based on whether there are active jobs running? In that regard, you should also be able to eliminate the need for m_needEmitProgress. |
Comment Actions
Good change in general, but why don't you simply start the timer at the place where showProgress() was emitted before, in case it's not running yet? Then you wouldn't need the "toggled on/off" state for the timer.
Comment Actions
You mean make the timer single shot and change to this in updateProgress?
if (!m_progressTimer.isActive()) { m_progressTimer.start(); }
Comment Actions
Since this patch, I frequently see the background parser idle but the progress bar displaying "0%" like it's doing something. Did anybody else see this?
Comment Actions
Maybe we need to move this check
//We don't hide the progress-bar in updateProgressBar, so it doesn't permanently flash when a document is reparsed again and again. if(m_doneParseJobs == m_maxParseJobs || (m_neededPriority == BackgroundParser::BestPriority && m_weaver.queueLength() == 0)) { emit m_parser->hideProgress(m_parser); }
to updateProgressBar().