pidgin/pidgin

Fix property warning when requesting an int field

14 months ago, Elliott Sales de Andrade
13adc8e7563d
Parents 01e68f28576f
Children f29c4d466cf5
Fix property warning when requesting an int field

The `GtkSpinButton` does not have an `activates-default` property, and so this
warned when creating an integer request field.

But `setup_entry_field` is only called in two places, so we can inline the
property setting to the place that needs it.

Testing Done:
Opened a request with an int field.

Reviewed at https://reviews.imfreedom.org/r/2291/
--- a/pidgin/gtkrequest.c Sat Feb 25 02:27:06 2023 -0600
+++ b/pidgin/gtkrequest.c Sat Feb 25 22:45:53 2023 -0600
@@ -1104,8 +1104,6 @@
{
const char *type_hint;
- g_object_set(entry, "activates-default", TRUE, NULL);
-
g_signal_connect(entry, "changed", G_CALLBACK(req_entry_field_changed_cb),
field);
@@ -1201,10 +1199,11 @@
if (purple_request_field_string_is_masked(field)) {
widget = gtk_password_entry_new();
- gtk_password_entry_set_show_peek_icon(GTK_PASSWORD_ENTRY(widget),
- TRUE);
+ g_object_set(widget, "activates-default", TRUE,
+ "show-peek-icon", TRUE, NULL);
} else {
widget = gtk_entry_new();
+ gtk_entry_set_activates_default(GTK_ENTRY(widget), TRUE);
}
setup_entry_field(widget, field);