After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 700642 - Use the new GtkBuilder support in GWeather
Use the new GtkBuilder support in GWeather
Status: RESOLVED FIXED
Product: gnome-clocks
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Clocks maintainer(s)
Clocks maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-05-19 15:45 UTC by Giovanni Campagna
Modified: 2013-05-19 16:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use the new GtkBuilder support in GWeather (4.59 KB, patch)
2013-05-19 15:45 UTC, Giovanni Campagna
none Details | Review
Use the new GtkBuilder support in GWeather (5.75 KB, patch)
2013-05-19 15:58 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2013-05-19 15:45:03 UTC
With that, we can move the location entry to Glade and simplify
our code.
Comment 1 Giovanni Campagna 2013-05-19 15:45:06 UTC
Created attachment 244716 [details] [review]
Use the new GtkBuilder support in GWeather
Comment 2 Paolo Borelli 2013-05-19 15:51:06 UTC
Review of attachment 244716 [details] [review]:

Thanks for the patch, it's always nice to see code removed :)

Just a minor comment below...

::: src/world.vala
@@ -24,2 +22,2 @@
 private GWeather.Location get_world_location () {
-    if (gweather_world == null) {
+    return new GWeather.Location.world (true);

This is a bit confusing, since it looks a lot like we are returning a new instance all the time...

Anyway, get_world_location is now used in just one place to call deserialize(), so please remove this helper function and call "new GWeather.Location.world (true);" locally
Comment 3 Giovanni Campagna 2013-05-19 15:58:54 UTC
Created attachment 244717 [details] [review]
Use the new GtkBuilder support in GWeather

With that, we can move the location entry to Glade and simplify
our code.
Comment 4 Paolo Borelli 2013-05-19 16:04:08 UTC
Review of attachment 244717 [details] [review]:

One more tiny nitpick, once you fix it feel free to push

::: src/world.vala
@@ +150,3 @@
+                // This looks like a constructor for historic reasons
+                // it returns the same instance after the first call
+                var world = new GWeather.Location.world (true);

even if it is returning the same instance, let's move this outside the foreach loop
Comment 5 Giovanni Campagna 2013-05-19 16:09:08 UTC
Attachment 244717 [details] pushed as c75f6e2 - Use the new GtkBuilder support in GWeather