GNOME Bugzilla – Bug 785342
color: Honor location enabled setting
Last modified: 2018-03-16 18:07:15 UTC
See patches.
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.
Created attachment 356301 [details] [review] color: Honor location enabled setting If location is disabled session wide we shouldn't use the service.
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
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?
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()
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
Can this be backported to 3.24?
*** Bug 781150 has been marked as a duplicate of this bug. ***