Use property system to coerce model data to G_TYPE_STRING

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=423201
This commit is contained in:
Christian Dywan 2010-10-15 16:29:30 +02:00 committed by Matthias Clasen
parent 50cbd23d5b
commit d70b7f49b6

View File

@ -5670,7 +5670,6 @@ gtk_combo_box_entry_active_changed (GtkComboBox *combo_box,
GtkComboBoxPrivate *priv = combo_box->priv; GtkComboBoxPrivate *priv = combo_box->priv;
GtkTreeModel *model; GtkTreeModel *model;
GtkTreeIter iter; GtkTreeIter iter;
gchar *str = NULL;
if (gtk_combo_box_get_active_iter (combo_box, &iter)) if (gtk_combo_box_get_active_iter (combo_box, &iter))
{ {
@ -5678,17 +5677,18 @@ gtk_combo_box_entry_active_changed (GtkComboBox *combo_box,
if (entry) if (entry)
{ {
GValue value = {0,};
g_signal_handlers_block_by_func (entry, g_signal_handlers_block_by_func (entry,
gtk_combo_box_entry_contents_changed, gtk_combo_box_entry_contents_changed,
combo_box); combo_box);
model = gtk_combo_box_get_model (combo_box); model = gtk_combo_box_get_model (combo_box);
gtk_tree_model_get (model, &iter, gtk_tree_model_get_value (model, &iter,
priv->text_column, &str, priv->text_column, &value);
-1); g_object_set_property (G_OBJECT (entry), "text", &value);
gtk_entry_set_text (entry, str); g_value_unset (&value);
g_free (str);
g_signal_handlers_unblock_by_func (entry, g_signal_handlers_unblock_by_func (entry,
gtk_combo_box_entry_contents_changed, gtk_combo_box_entry_contents_changed,