[gnome-settings-daemon] color: Valid latitude range is between -90 and +90
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] color: Valid latitude range is between -90 and +90
- Date: Thu, 9 Feb 2017 19:22:36 +0000 (UTC)
commit d1e0b294c9aa701d0ec704630333893f2a1a1e8f
Author: Richard Hughes <richard hughsie com>
Date: Thu Feb 9 19:21:31 2017 +0000
color: Valid latitude range is between -90 and +90
...settings-daemon.plugins.color.gschema.xml.in.in | 2 +-
plugins/color/gsd-natural-light-common.c | 4 ++--
plugins/color/gsd-natural-light.c | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/data/org.gnome.settings-daemon.plugins.color.gschema.xml.in.in
b/data/org.gnome.settings-daemon.plugins.color.gschema.xml.in.in
index 7fb36a0..0ede7af 100644
--- a/data/org.gnome.settings-daemon.plugins.color.gschema.xml.in.in
+++ b/data/org.gnome.settings-daemon.plugins.color.gschema.xml.in.in
@@ -36,7 +36,7 @@
<_description>When “natural-light-schedule-automatic” is disabled, use this end time in hours from
midnight.</_description>
</key>
<key name="natural-light-last-coordinates" type="(dd)">
- <default>(181,181)</default>
+ <default>(91,91)</default>
<_summary>The last detected position</_summary>
<_description>When location services are available this represents the last detected location. The
default value is an invalid value to ensure it is always updated at startup.</_description>
</key>
diff --git a/plugins/color/gsd-natural-light-common.c b/plugins/color/gsd-natural-light-common.c
index 9150de6..456f457 100644
--- a/plugins/color/gsd-natural-light-common.c
+++ b/plugins/color/gsd-natural-light-common.c
@@ -54,8 +54,8 @@ gsd_natural_light_get_sunrise_sunset (GDateTime *dt,
g_autoptr(GDateTime) dt_zero = g_date_time_new_utc (1900, 1, 1, 0, 0, 0);
GTimeSpan ts = g_date_time_difference (dt, dt_zero);
- g_return_val_if_fail (pos_lat < 180.f && pos_lat > -180.f, FALSE);
- g_return_val_if_fail (pos_long < 180.f && pos_long > -180.f, FALSE);
+ g_return_val_if_fail (pos_lat < 90.f && pos_lat > -90.f, FALSE);
+ g_return_val_if_fail (pos_long < 90.f && pos_long > -90.f, FALSE);
gdouble tz_offset = g_date_time_get_utc_offset (dt) / G_USEC_PER_SEC / 60 / 60; // B5
gdouble date_as_number = ts / G_USEC_PER_SEC / 24 / 60 / 60 + 2; // B7
diff --git a/plugins/color/gsd-natural-light.c b/plugins/color/gsd-natural-light.c
index dedbd74..295ec87 100644
--- a/plugins/color/gsd-natural-light.c
+++ b/plugins/color/gsd-natural-light.c
@@ -108,9 +108,9 @@ update_cached_sunrise_sunset (GsdNaturalLight *self)
/* calculate the sunrise/sunset for the location */
tmp = g_settings_get_value (self->settings, "natural-light-last-coordinates");
g_variant_get (tmp, "(dd)", &latitude, &longitude);
- if (latitude > 180.f || latitude < -180.f)
+ if (latitude > 90.f || latitude < -90.f)
return FALSE;
- if (longitude > 180.f || longitude < -180.f)
+ if (longitude > 90.f || longitude < -90.f)
return FALSE;
if (!gsd_natural_light_get_sunrise_sunset (dt_now, latitude, longitude,
&sunrise, &sunset)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]