Bug 150835 - KMail wakes up every second
Summary: KMail wakes up every second
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: 1.9.6
Platform: Unlisted Binaries Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-14 19:16 UTC by Alan Jenkins
Modified: 2010-01-11 10:14 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.