[gnome-clocks/wip/cityimages] Create a GWeather.Info instance without using the forecast data



commit c987c9f109baad45c6508ae5f62c6b172c1b6412
Author: Evgeny Bobkin <evgen ibqn gmail com>
Date:   Fri Sep 20 17:19:39 2013 +0200

    Create a GWeather.Info instance without using the forecast data

 src/world.vala |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/world.vala b/src/world.vala
index 8431b01..5959738 100644
--- a/src/world.vala
+++ b/src/world.vala
@@ -151,6 +151,12 @@ private class Item : Object, ContentItem {
 
         update_images (file_name);
 
+        // We don't need to call update(), we're using only astronomical data
+        // NOTE: The creation of instance without specifying location causes a segmentation
+        // fault, probably because location in not set to NULL in the init function
+        //weather_info = (GWeather.Info) Object.new (typeof (GWeather.Info));
+        weather_info = (GWeather.Info) Object.new (typeof (GWeather.Info), "location", location);
+
         tick ();
     }
 
@@ -170,8 +176,8 @@ private class Item : Object, ContentItem {
         local_time = wallclock.date_time;
         date_time = local_time.to_timezone (time_zone);
 
-        // We don't need to call update(), we're using only astronomical data
-        weather_info = new GWeather.Info (location, GWeather.ForecastType.LIST);
+        // This forces the recalculation of the sunrise and sunset data
+        weather_info.set_location (location);
     }
 
     public void get_thumb_properties (out string text, out string subtext, out Gdk.Pixbuf? pixbuf, out 
string css_class) {


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