Summary: | [PATCH] select active battery, option to ignore nonexsistent battery | ||
---|---|---|---|
Product: | [Unmaintained] plasma4 | Reporter: | Szabolcs Illes <s.illes79> |
Component: | general | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | mail, rdieter |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
Patch against svn revision 767340
Fix counting of batteries so that the cumulative charge ignores empty batteries |
Description
Szabolcs Illes
2008-01-24 21:23:50 UTC
*** This bug has been marked as a duplicate of 155239 *** Created attachment 23314 [details]
Patch against svn revision 767340
This patch adds a configuration option for the battery widget to make it ignore
empty batteries bays.
Reopening this. The discussion in bug 155239 has closed without taking into account the option of ignoring missing batteries. bug 156652 resulted but it asks for the selection of an arbitrary battery which is beyond simply omitting the missing batteries. I have also added a patch to add this functionality and hope it can get tested and committed. In fact selecting the battery of interest is not the same as ignoring missing batteries. If a battery is plugged in, this battery would get ignored if it is not selected to start with. I think a nicer solution would be to ignore empty bays when 'cumulative' mode is used. That saves a config option. Also, I can't think of a usecase where it makes sense to keep an empty bay into account when checking for charge percentage. I have committed a patch which does that last Saturday, can you check if this behaviour works for you, and re-open + explain why it doesn't if not? The code currently (svn of now, revision 767556) still takes empty bays into account in cumulative mode. In particular I think that the patch from Revision 766341 to 766875 puts an if () in the wrong part of the code (at line 542 instead of 555) Created attachment 23332 [details]
Fix counting of batteries so that the cumulative charge ignores empty batteries
I still think that the patch in comment 2 is useful if you want to show battery details, yet only the present batteries are to be shown. Thus if you have 2 batteries and one is missing, only 1 is shown. When you plug in the second one, it gets displayed next to it. (I have not tested hotplugging, and it might need an additional update() call in the dataUpdated() function) Useful, maybe, but I wonder how common this case actually is. I'd like to avoid cluttering the UI too much, and such a config option comes at a certain cost .... I've corrected the battery_num counting, thanks for that! I would agree that adding additional option would be adding lots of complexity (used by limited number of users). I think best would be to just add/remove plugged batteries automatically (always). No battery case would therefore be only used if there is no battery at all. See also bug 156652 |