diff -r d2f5ce624a49 -r 2bf2cc598a0e pidgin/prefs/pidginprefs.c --- a/pidgin/prefs/pidginprefs.c Tue May 17 01:58:53 2022 -0500 +++ b/pidgin/prefs/pidginprefs.c Tue May 17 01:58:54 2022 -0500 @@ -393,83 +393,6 @@ } void -pidgin_prefs_bind_dropdown_from_list(PidginPrefCombo *combo, GList *menuitems) -{ - gchar *text; - GtkListStore *store = NULL; - GtkTreeIter iter; - GtkTreeIter active; - int configured_int_value = 0; - const char *configured_str_value = NULL; - gboolean configured_bool_value = FALSE; - - g_return_if_fail(menuitems != NULL); - - if (combo->type == PURPLE_PREF_INT) { - configured_int_value = purple_prefs_get_int(combo->key); - } else if (combo->type == PURPLE_PREF_STRING) { - configured_str_value = purple_prefs_get_string(combo->key); - } else if (combo->type == PURPLE_PREF_BOOLEAN) { - configured_bool_value = purple_prefs_get_bool(combo->key); - } else { - g_return_if_reached(); - } - - store = GTK_LIST_STORE( - gtk_combo_box_get_model(GTK_COMBO_BOX(combo->combo))); - - while (menuitems != NULL && (text = (char *)menuitems->data) != NULL) { - int int_value = 0; - const char *str_value = NULL; - gboolean bool_value = FALSE; - - menuitems = g_list_next(menuitems); - g_return_if_fail(menuitems != NULL); - - gtk_list_store_append(store, &iter); - gtk_list_store_set(store, &iter, - PREF_DROPDOWN_TEXT, text, - -1); - - if (combo->type == PURPLE_PREF_INT) { - int_value = GPOINTER_TO_INT(menuitems->data); - gtk_list_store_set(store, &iter, - PREF_DROPDOWN_VALUE, int_value, - -1); - } - else if (combo->type == PURPLE_PREF_STRING) { - str_value = (const char *)menuitems->data; - gtk_list_store_set(store, &iter, - PREF_DROPDOWN_VALUE, str_value, - -1); - } - else if (combo->type == PURPLE_PREF_BOOLEAN) { - bool_value = (gboolean)GPOINTER_TO_INT(menuitems->data); - gtk_list_store_set(store, &iter, - PREF_DROPDOWN_VALUE, bool_value, - -1); - } - - if ((combo->type == PURPLE_PREF_INT && - configured_int_value == int_value) || - (combo->type == PURPLE_PREF_STRING && - purple_strequal(configured_str_value, str_value)) || - (combo->type == PURPLE_PREF_BOOLEAN && - (configured_bool_value == bool_value))) { - - active = iter; - } - - menuitems = g_list_next(menuitems); - } - - gtk_combo_box_set_active_iter(GTK_COMBO_BOX(combo->combo), &active); - - g_signal_connect(G_OBJECT(combo->combo), "changed", - G_CALLBACK(bind_dropdown_set), combo); -} - -void pidgin_prefs_bind_dropdown(PidginPrefCombo *combo) { GtkTreeModel *store = NULL;