GNOME Bugzilla – Bug 720825
Failure to map handlers for signals with details
Last modified: 2014-01-06 10:33:02 UTC
With the following UI definition: ----------UI definition---- <template class="BoxesUnattendedSetupBox" parent="GtkBox"> ... <child> <object class="GtkEntry" id="username_entry"> <signal name="notify::text" handler="on_mandatory_input_changed"/> <signal name="activate" handler="on_username_entry_activated"/> </object> --------------------------- and this code: ----------CODE------------- [GtkTemplate (ui = "/org/gnome/Boxes/ui/unattended-setup-box.ui")] private class Boxes.UnattendedSetupBox : Gtk.Box { .. [GtkCallback] private void on_mandatory_input_changed () { notify_property ("ready-to-create"); } [GtkCallback] private void on_username_entry_activated () { if (ready_for_express) user_wants_to_create (); else if (username != "" && product_key_format != null) product_key_entry.grab_focus (); // If username is provided, must be product key thats still not provided } ------------------------- I get an error from valac: unattended-setup-box.vala:109.5-109.43: error: could not find signal for handler `on_mandatory_input_changed' private void on_mandatory_input_changed () { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ However there is no warning about handlers of signals that do not have details, e.g 'on_username_entry_activated' above.
Vala fails to split the signal name on the "::" token before checking if the signal name exists. Current master: codegen/valagtkmodule.vala line 275
commit 86bf398bdff96c03ffb34ef0a60d311557db5077 Author: Luca Bruno <lucabru@src.gnome.org> Date: Mon Jan 6 11:31:41 2014 +0100 gtktemplate: Handle callbacks for detailed signals Fixes bug 720825 This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.