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 709774 - datetime: Fix incorrect sensitivity when permission is missing
datetime: Fix incorrect sensitivity when permission is missing
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-10-09 21:35 UTC by Bastien Nocera
Modified: 2015-07-10 15:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
datetime: Fix incorrect sensitivity when permission is missing (1.02 KB, patch)
2013-10-09 21:35 UTC, Bastien Nocera
none Details | Review
datetime: Fix incorrect sensitivity when permission is missing (1.02 KB, patch)
2013-10-10 00:49 UTC, Bastien Nocera
none Details | Review
datetime: Fix incorrect sensitivity when permission is missing (1.53 KB, patch)
2015-07-10 15:14 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2013-10-09 21:35:00 UTC
.
Comment 1 Bastien Nocera 2013-10-09 21:35:03 UTC
Created attachment 256854 [details] [review]
datetime: Fix incorrect sensitivity when permission is missing

When the permission is missing, we shouldn't make the rows sensitive.
Comment 2 Bastien Nocera 2013-10-10 00:49:07 UTC
Created attachment 256866 [details] [review]
datetime: Fix incorrect sensitivity when permission is missing

When the permission is missing, we shouldn't make the rows sensitive.
Comment 3 Kalev Lember 2013-10-10 08:20:27 UTC
This was probably coded that way in order to keep the panel working with broken installations, where /usr/share/polkit-1/org.gnome.controlcenter.datetime.policy is missing.

Not sure if we should support that case or not; the broken installation can happen for instance when gnome-control-center isn't installed systemwide and someone builds it to a private prefix with jhbuild.

The current behaviour is to keep the buttons sensitive when the policy file is missing, and rely on the policykit dialogs popping up when the user clicks on one of the buttons.

If we want to get rid of that logic, I think instead of making the rows insensitive, it would be better to fail early in the panel's constructor (and kill the NULL checks in the rest of the code). Making the rows insensitive just makes the panel look broken.
Comment 4 Kalev Lember 2013-10-10 09:55:04 UTC
Review of attachment 256866 [details] [review]:

::: panels/datetime/cc-datetime-panel.c
@@ +931,2 @@
   active = g_value_get_boolean (source_value);
+  allowed = (priv->permission != NULL && g_permission_get_allowed (priv->permission));

There's another one of these NULL permission checks in on_permission_changed, can you update that one too to match?
Comment 5 Bastien Nocera 2015-07-10 15:14:16 UTC
Created attachment 307230 [details] [review]
datetime: Fix incorrect sensitivity when permission is missing

When the permission is missing, we shouldn't make the rows sensitive.
Comment 6 Bastien Nocera 2015-07-10 15:17:04 UTC
Attachment 307230 [details] pushed as ac59708 - datetime: Fix incorrect sensitivity when permission is missing