Comment 89 for bug 135548

Revision history for this message
Joakim Andersson (jocke) wrote : Re: [Gutsy] Action on critical battery isn't triggered - regression

As I said in my last comment, I would submit my patch when I was done with it, and here it is.

Cited from the changelog of my patched package:
   * Added 11_policy_actions_fallback.patch which makes policy actions
     fall back to per-percent policy if the battery profile is not good
     enough yet. It also ignores the accuracy of the battery profile when
     the GCONF key 'use_time_for_policy' is disabled. LP: #135548
   * Added 12_fix_critical_message.patch which fixes an error in the
     notification messages for critical battery. These messages would
     always show 0% battery remaining, since the cell unit object was
     reset while generating one of the strings used in the message.

(yup, the second point means I found another bug as well)

I'm attaching the .diff.gz file generated by dpkg-build package, since that is the simplest way for me to attach all my changes in one file.

A small disclaimer: I'm no C guru, and this was actually the first thing I did with GTK based code. That means my solutions may not be "correct", but they work for me, as far as I could tell.