[gnome-clocks/wip/geoinfo] rename radius to earth_radius



commit 7f4f79655c3380a98e82e1d622628fd8c603d885
Author: Evgeny Bobkin <evgen ibqn gmail com>
Date:   Tue Sep 10 12:05:00 2013 +0200

    rename radius to earth_radius
    
    catch generic error corresponding to bindings

 src/geocoding.vala |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/geocoding.vala b/src/geocoding.vala
index 9c373a8..ffec2e7 100644
--- a/src/geocoding.vala
+++ b/src/geocoding.vala
@@ -135,7 +135,7 @@ public class Info : Object {
 
             // Reverse geocoding returns country code which is not uppercased
             country_code = country_code.up ();
-        } catch (IOError e) {
+        } catch (Error e) {
             warning ("Failed to obtain country code: %s", e.message);
         }
     }
@@ -145,14 +145,14 @@ public class Info : Object {
     }
 
     private double get_distance (double latitude1, double longitude1, double latitude2, double longitude2) {
-        const double radius = 6372.795;
+        const double earth_radius = 6372.795;
 
         double lat1 = deg_to_rad (latitude1);
         double lat2 = deg_to_rad (latitude2);
         double lon1 = deg_to_rad (longitude1);
         double lon2 = deg_to_rad (longitude2);
 
-        return Math.acos (Math.cos (lat1) * Math.cos (lat2) * Math.cos (lon1 - lon2) + Math.sin (lat1) * 
Math.sin (lat2)) * radius;
+        return Math.acos (Math.cos (lat1) * Math.cos (lat2) * Math.cos (lon1 - lon2) + Math.sin (lat1) * 
Math.sin (lat2)) * earth_radius;
     }
 
     private async void search_locations (GWeather.Location location) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]