After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 771542 - update_automatic_suspend_label() fixes
update_automatic_suspend_label() fixes
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Power
unspecified
Other All
: Normal normal
: ---
Assigned To: Richard Hughes
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-09-16 15:37 UTC by Bastien Nocera
Modified: 2016-09-20 08:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
power: Simplify update_automatic_suspend_label() (1.85 KB, patch)
2016-09-16 15:37 UTC, Bastien Nocera
committed Details | Review
power: Warn if automatic suspend timeouts are negative (1.50 KB, patch)
2016-09-16 15:38 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2016-09-16 15:37:52 UTC
.
Comment 1 Bastien Nocera 2016-09-16 15:37:57 UTC
Created attachment 335717 [details] [review]
power: Simplify update_automatic_suspend_label()

By replacing the magic 0 by its meaning ("never") as explained in the
gnome-settings-daemon GSettings schemas.
Comment 2 Bastien Nocera 2016-09-16 15:38:03 UTC
Created attachment 335718 [details] [review]
power: Warn if automatic suspend timeouts are negative

They should probably have been unsigned integers, but they're not, so
warn if they are. The rest of the code handles negative values as if
they were 0.
Comment 3 Michael Catanzaro 2016-09-16 16:37:29 UTC
Review of attachment 335717 [details] [review]:

::: panels/power/cc-power-panel.c
@@ +1935,3 @@
 }
 
+#define NEVER 0

It's never unwise to #undef when you're done with it
Comment 4 Bastien Nocera 2016-09-20 08:32:19 UTC
(In reply to Michael Catanzaro from comment #3)
> Review of attachment 335717 [details] [review] [review]:
> 
> ::: panels/power/cc-power-panel.c
> @@ +1935,3 @@
>  }
>  
> +#define NEVER 0
> 
> It's never unwise to #undef when you're done with it

What does that help? It only adds more code.
Comment 5 Bastien Nocera 2016-09-20 08:40:32 UTC
Attachment 335717 [details] pushed as cc4e134 - power: Simplify update_automatic_suspend_label()
Attachment 335718 [details] pushed as 1abacd2 - power: Warn if automatic suspend timeouts are negative