[glib] Update the battery provider to UPower 1.0
Created attachment 224627 [details] Patch
Attachment 224627 [details] did not pass style-queue: ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:30: Alphabetical sorting problem. [build/include_order] [4] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:36: Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side. [whitespace/operators] [4] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:36: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:37: Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side. [whitespace/operators] [4] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:37: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:37: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:38: Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side. [whitespace/operators] [4] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:38: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:38: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:39: Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side. [whitespace/operators] [4] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:39: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:39: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:40: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:40: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:58: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:84: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:85: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:86: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:87: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:88: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:89: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:90: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:97: Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side. [whitespace/operators] [4] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:98: Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side. [whitespace/operators] [4] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:100: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] ERROR: Source/WebCore/platform/glib/BatteryProviderUPower.cpp:102: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Total errors found: 26 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
This also needs a ChangeLog :) Also, we're moving from automake to cmake for the build. It seems that our current cmake setup doesn't check the presence of upower-glib, would you mind providing a patch for this? I suppose a new WebCore/cmake/FindUPower.cmake module would be required.
So I was wondering why our battery provider was not horribly broken, considering that upower 1.0 removed all the D-Bus API it relies on before the original battery support was even committed. Turns out these files are not built at all (they were added only to the autotools build). So it's all dead code. Unofficial r- from me; we need to get this building again. Note: the battery provider cannot possibly ever work without this patch.
Also, the comments of the style checker are not optional; WebKit coding style is different from what's normal in GNOME.
Well, given that this code is not actually used, and given that I don't have a lot of free time these days, I don't think I will work on improving it. Hope you find it useful for a subsequent properly cleaned up patch, otherwise just close the bug and sorry for the noise.
No, of course it's useful, thanks for submitting it. :)
Comment on attachment 224627 [details] Patch r- given previous comments. No objections specifically from me, but this shouldn't be in the review queue.
We should either delete this code, or figure out what the battery provider is for, clean up this patch, and get it hooked up somehow. Any preferences?
The API this code is intended to support is being removed, see bug #164213