Bug 150835

Summary: KMail wakes up every second
Product: [Applications] kmail Reporter: Alan Jenkins <alan.christopher.jenkins>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: wishlist CC: bjoern
Priority: NOR    
Version: 1.9.6   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:

Description Alan Jenkins 2007-10-14 19:16:40 UTC
Version:           1.9.6 (using KDE KDE 3.5.6)
Installed from:    Unspecified Linux
OS:                Linux

KMHeaders:2049:

void KMHeaders::resetCurrentTime()
{
    mDate.reset();
    QTimer::singleShot( 1000, this, SLOT( resetCurrentTime() ) );
}

I'm guessing mDate.reset() is responsible for updating "Yesterday"/"Thursday"/"2007-10-8" in the messages list.

Proposed fix: change it to only wake up once every minute.  Align the timer to schedule it for the exact time the minute changes.  The alignment is what's stopping me posting a patch immediately, but I'm sure it won't take me long to find the code for "how long until the next minute rolls over?".
Comment 1 Björn Ruberg 2010-01-11 00:41:07 UTC
Can you just check whether this line is still present in current kmail? Should be an easy way to redruce the amount of wake ups
Comment 2 Alan Jenkins 2010-01-11 10:14:50 UTC
Hmm, not sure where this line would have been moved to...

I don't think it's there anymore.  <http://source.debian.net/source/search?q=1000&defs=&refs=QTimer&path=kmail&hist=>.

I don't use kmail anymore.  But I tested it with a single message in the local drafts folder, and it showed 0.3 wakeups/s.

So I'm fairly confident this specific annoyance is gone.  Let's close the bug.