GNOME Bugzilla – Bug 737818
Gnome-weather does not work: Invalid object type `GWeatherLocationEntry'
Last modified: 2014-10-06 19:41:49 UTC
Hi, gnome-weather isn't working for me here. This is what I get: [asinha@localhost ~]$ gnome-weather (org.gnome.Weather.Application:10862): Gjs-WARNING **: JS ERROR: Gtk.BuilderError: Invalid object type `GWeatherLocationEntry' on line 2 MainWindow<._init@resource:///org/gnome/Weather/Application/js/app/window.js:57 wrapper@resource:///org/gnome/gjs/modules/lang.js:169 Application<._createWindow@resource:///org/gnome/Weather/Application/js/app/main.js:112 wrapper@resource:///org/gnome/gjs/modules/lang.js:169 Application<.vfunc_activate@resource:///org/gnome/Weather/Application/js/app/main.js:141 wrapper@resource:///org/gnome/gjs/modules/lang.js:169 main@resource:///org/gnome/Weather/Application/js/app/main.js:154 run@resource:///org/gnome/gjs/modules/package.js:192 @/usr/bin/gnome-weather:6 According to Clocks, my location is "Luton, United Kingdom". I've rebooted to ensure all updates were applied, and the error still persists. [asinha@localhost ~]$ rpm -q gjs gnome-weather gjs-1.42.0-1.fc21.x86_64 gnome-weather-3.14.0-1.fc21.noarch
Created attachment 287668 [details] [review] Adapt to a GtkBuilder change GtkBuilder relies on heuristics to guess the name of the get_type function from a class name. Recently, these heuristics were changed slightly to fix a few cases. Sadly, that makes it get the GWeather... -> gweather... wrong. To avoid guessing games, just specify the get_type function explicitly in the ui file.
Created attachment 287670 [details] [review] Same change in another place This is not currently needed, since the class name will work once the type is registered, but better avoid an ordering dependency and just use the type-func here, too.
I'm reverting the heuristics changes in GTK+, but it might be a good idea to apply these patches anyway.
Kalev pushed an update to F21 with the gtk+ reversions and it fixes the issue. Thanks Matthias.
I don't like using type-funcs in GtkBuilder, because they are a lot less readable than the object names, they are inconsistent with gtk+, and they rely on C details which should be invisible in a JS app. I pushed a different fix instead, which is to eagerly ensure the type when the app is started up.