Commit f38ecb9c authored by Bob Ham's avatar Bob Ham

dialer: fix emission of number property change signals

The dialer was not emitting notify signals when the number GObject
property was set.  The property is flagged with
G_PARAM_EXPLICIT_NOTIFY.  We fix this by emitting the signal in
hdy_dialer_set_property.  And adding a test to check.
parent 922ddae0
......@@ -169,6 +169,7 @@ hdy_dialer_set_property (GObject *object,
switch (property_id) {
case PROP_NUMBER:
g_string_assign (priv->number, g_value_get_string (value));
g_object_notify_by_pspec (object, pspec);
break;
default:
......
......@@ -34,11 +34,13 @@ test_hdy_dialer_setnumber(void)
/* Check that we're assigning to the string and not overwriting */
hdy_dialer_set_number(HDY_DIALER (dialer), "#123");
g_assert_cmpstr("#1234", !=, hdy_dialer_get_number(HDY_DIALER (dialer)));
g_assert_cmpint(2, ==, notified);
/* Do the same using the GObject property */
g_object_set(G_OBJECT (dialer), "number", "#12", NULL);
g_assert_cmpstr("#123", !=, hdy_dialer_get_number(HDY_DIALER (dialer)));
g_assert_cmpstr("#12", ==, hdy_dialer_get_number(HDY_DIALER (dialer)));
g_assert_cmpint(3, ==, notified);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment