[PATCH] Delayed notify - performance

Roger Larsson roger.larsson at norran.net
Mon Mar 8 08:40:21 CET 2004

On Sunday 07 March 2004 14.39, Patrick Julien wrote:
> Use a proper constant for kis_notify_limit...

A constant can not be changed. So testers of the patch could
not check how different values perform.

> Call m_dragNotifyTime.start() in the constructor.

Why? The timing does not start here?
It starts when the button is pressed.
I think this would only confuse things...

> Then use 
> m_dragNotifyTime.restart() in timeToNotify() so that you fall within
> documented behavior of QTime.

Current code
+    if (m_dragNotifyTime.elapsed() > kis_notify_limit)
+    {
+       m_dragNotifyTime.start();

+    if (m_dragNotifyTime.restart() > kis_notify_limit)
+    {

This is wrong since it will restart the timer everytime timeToNotify is 
called. That is not the intended behavior.

+    if (m_dragNotifyTime.elapsed() > kis_notify_limit)
+    {
+       m_dragNotifyTime.restart();

This will return a value that I am not interested in. 
But m_dragNotifyTime.start(); is documented to set the
timer to current time - that is the intended behaviour.

But a .restart() could be slightly easier to read and understand.


Roger Larsson

More information about the kimageshop mailing list