[REVIEW] removing (probably) unnecessary condition in dataUpdated(...)
Rafał Miłecki
zajec5 at gmail.com
Fri Apr 11 10:10:03 CEST 2008
http://websvn.kde.org/trunk/KDE/kdebase/workspace/plasma/applets/digital-clock/clock.cpp?revision=795311&view=markup
Inside void Clock::dataUpdated(...) we currently use such a avoiding code:
// avoid unnecessary repaints
if (m_showSeconds || m_time.minute() != m_lastTimeSeen.minute()) {
m_lastTimeSeen = m_time;
update();
}
else {
kDebug() << "Oh, our avoiding code is usefully!";
}
What I claim is that this whole condition is not necessary. I wish to
remove this leaving just one line:
update();
As far as I understand DataEngine it takes updateIntreval parameter in
connectSource which we use (we put 1sec or 60secs). As the result we
have dataUpdate(...) called *only* as often as it's needed. That is
why I belive this whole condition is unnecessary. There are simply no
dataUpdate(...) calls which we should ignore.
If you use current SVN, you can even try
grep 'avoiding code' ~/.xsession-errors
As far as I tested this, I didn't get any such a message.
I wish to remove this condition and leave just update(). If there are
some objections, please tell.
--
Rafał Miłecki
More information about the Panel-devel
mailing list