Version: (using KDE KDE 3.5.6) Installed from: Unspecified Linux OS: Linux Idle computers sleep to save power. Sucky applications wake up idle computers for no reason, wasting power. This is the wisdom of powertop[1]. Since I prefer to use non sucky applications, heres a patch which removes the storage backends charming habit of waking up every 3 seconds to see whether there are changes to commit to disk. I preserve the behaviour of batching commits over 3 second intervals, and of making sure changes are commited within 3 seconds. Disclaimer: I'm not a KDE dev; it looks good to me but it who knows if it'll eat your data. Taste-wise, maybe my new method should be "markModified()" for consistency, but "markDirty()" is clearer to me. The commitTimer is now used as a single-shot, so maybe it should be ditched in favour of QTimer::singleShot(). [1] www.linuxpowertop.org
Created attachment 21733 [details] Fix storage backend polling This can be tested by comparing powertop output before and after. Before, powertop should show ~0.4 wakeups/s on idle. After, it should hardly show up at all (when idle). Note. "idle" includes "not fetching feeds". I.e. this wouldn't make a difference if, like me, you had a dead feed that akregator keeps trying to refetch.
Created attachment 21751 [details] Improved patch using QTimer::singleShot() I changed your patch a bit, it now uses QTimer::singleShot() instead of an own QTimer object, moves markDirty() to private section of the class. (Is there any reason not to do so?)
Looks fine to me. I was slightly puzzled by the lack of existing private methods so I put it next to slotCommit(). (Perhaps it's not usual to declare a slot as private?) Thanks for looking at it! P.S. I wonder how many people would take it the wrong way if I said I'd posted a patch on the "akregator haxx0rz" website :-).
Created attachment 21761 [details] Corrected version which takes feed storage changes into account
SVN commit 721755 by ewoerner: Fix storage backend waking up CPU every 3 seconds, original patch by Alan Jenkins, bump version number BUG: 150389 M +9 -1 ChangeLog M +1 -1 src/aboutdata.h M +31 -21 src/mk4storage/feedstoragemk4impl.cpp M +1 -0 src/mk4storage/feedstoragemk4impl.h M +17 -14 src/mk4storage/storagemk4impl.cpp M +2 -0 src/mk4storage/storagemk4impl.h WebSVN link: http://websvn.kde.org/?view=rev&revision=721755