[gnome-settings-daemon] Revert "color: Valid latitude range is between -90 and +90"



commit b10a13c636655d758c52fa57a6278b5376d4bc78
Author: Richard Hughes <richard hughsie com>
Date:   Thu Feb 9 21:02:35 2017 +0000

    Revert "color: Valid latitude range is between -90 and +90"
    
    This reverts commit d1e0b294c9aa701d0ec704630333893f2a1a1e8f.

 ...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 0ede7af..7fb36a0 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>(91,91)</default>
+      <default>(181,181)</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 456f457..9150de6 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 < 90.f && pos_lat > -90.f, FALSE);
-        g_return_val_if_fail (pos_long < 90.f && pos_long > -90.f, FALSE);
+        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);
 
         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 295ec87..dedbd74 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 > 90.f || latitude < -90.f)
+        if (latitude > 180.f || latitude < -180.f)
                 return FALSE;
-        if (longitude > 90.f || longitude < -90.f)
+        if (longitude > 180.f || longitude < -180.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]