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;
GtkTreeModel *model;
GtkTreeIter iter;
gchar *str = NULL;
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)
{
GValue value = {0,};
g_signal_handlers_block_by_func (entry,
gtk_combo_box_entry_contents_changed,
combo_box);
model = gtk_combo_box_get_model (combo_box);
gtk_tree_model_get (model, &iter,
priv->text_column, &str,
-1);
gtk_entry_set_text (entry, str);
g_free (str);
gtk_tree_model_get_value (model, &iter,
priv->text_column, &value);
g_object_set_property (G_OBJECT (entry), "text", &value);
g_value_unset (&value);
g_signal_handlers_unblock_by_func (entry,
gtk_combo_box_entry_contents_changed,