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 785342 - color: Honor location enabled setting
color: Honor location enabled setting
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: color
unspecified
Other All
: Normal normal
: ---
Assigned To: Richard Hughes
gnome-settings-daemon-maint
: 781150 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2017-07-24 13:54 UTC by Rui Matos
Modified: 2018-03-16 18:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
color: Request location updates with a larger time granularity (1.29 KB, patch)
2017-07-24 13:54 UTC, Rui Matos
committed Details | Review
color: Honor location enabled setting (4.17 KB, patch)
2017-07-24 13:54 UTC, Rui Matos
committed Details | Review

Description Rui Matos 2017-07-24 13:54:21 UTC
See patches.
Comment 1 Rui Matos 2017-07-24 13:54:25 UTC
Created attachment 356300 [details] [review]
color: Request location updates with a larger time granularity

By default geoclue gives us location updates whenever they're
available which might be very frequently. As these updates are written
to disk and we don't really need them very frequently, we can request
them to be less frequent. Once per hour should be good enough for
our night light purposes.
Comment 2 Rui Matos 2017-07-24 13:54:30 UTC
Created attachment 356301 [details] [review]
color: Honor location enabled setting

If location is disabled session wide we shouldn't use the service.
Comment 3 Zeeshan Ali 2017-07-24 15:05:51 UTC
Review of attachment 356300 [details] [review]:

Shortlog can be made to easily fit under idea 50 chars limit. E.g "Less frequent location updates".

::: plugins/color/gsd-night-light.c
@@ +451,3 @@
         self->geoclue_client = gclue_simple_get_client (self->geoclue_simple);
+        g_object_set (G_OBJECT (self->geoclue_client),
+                      "time-threshold", 60*60, NULL); /* 1 hour */

I'd rather you hardcode 3600 here and add a comment // 1 hour
Comment 4 Zeeshan Ali 2017-07-24 15:18:00 UTC
Review of attachment 356301 [details] [review]:

::: plugins/color/gsd-night-light.c
@@ +486,3 @@
+check_location_settings (GsdNightLight *self)
+{
+        if (self->geoclue_client != NULL)

Isn't the line limit 80 chars? I'd like to see the second condition on new line anyway.

@@ -551,3 @@
-                g_clear_object (&self->cancellable);
-        }
-

are these changes really relevant to this patch?
Comment 5 Rui Matos 2017-07-24 16:10:36 UTC
Review of attachment 356301 [details] [review]:

::: plugins/color/gsd-night-light.c
@@ +486,3 @@
+check_location_settings (GsdNightLight *self)
+{
+        if (g_settings_get_boolean (self->location_settings, "enabled") && self->geoclue_enabled)

I don't think we have a hard rule, not recently at least.

@@ -551,3 @@
-                g_clear_object (&self->cancellable);
-        }
-

Yes because the cancellable and the geoclue instances are now entirely managed in start/stop_geoclue()
Comment 6 Rui Matos 2017-07-24 16:14:38 UTC
Zeeshan, thanks for the review. hughsie and kalev had already given
their acks on IRC so this was pushed while you were typing I
guess. That's why I couldn't address your comments

Attachment 356300 [details] pushed as 991e82f - color: Request location updates with a larger time granularity
Attachment 356301 [details] pushed as 6a8c981 - color: Honor location enabled setting
Comment 7 Jan Tojnar 2017-08-21 11:39:45 UTC
Can this be backported to 3.24?
Comment 8 Benjamin Berg 2018-03-16 18:07:15 UTC
*** Bug 781150 has been marked as a duplicate of this bug. ***