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 720825 - Failure to map handlers for signals with details
Failure to map handlers for signals with details
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: general
0.22.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2013-12-20 15:12 UTC by Zeeshan Ali
Modified: 2014-01-06 10:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Zeeshan Ali 2013-12-20 15:12:46 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.
Comment 1 Tristan Van Berkom 2013-12-20 15:34:51 UTC
Vala fails to split the signal name on the "::" token before checking if
the signal name exists.

Current master: codegen/valagtkmodule.vala line 275
Comment 2 Luca Bruno 2014-01-06 10:33:02 UTC
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.