diff options
author | Matthias Clasen <mclasen@redhat.com> | 2010-10-23 19:28:05 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2010-10-23 19:34:20 +0200 |
commit | 7651c231e0c6295e8aaa8de23931004ddfdd288b (patch) | |
tree | a7bf0891ca8bcf734c6e1a9ce34211cdcb1515af | |
parent | 051dcde4bf8b1852bfbd903a31be3f03d2ed3339 (diff) | |
download | gtk+-7651c231e0c6295e8aaa8de23931004ddfdd288b.tar.gz |
Revert the id-column patch
It didn't quite turn out as I wanted it.
I'll put it in bug 619148 for now.
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | docs/reference/gtk/gtk3-sections.txt | 5 | ||||
-rw-r--r-- | gtk/gtk.symbols | 3 | ||||
-rw-r--r-- | gtk/gtkcombobox.c | 80 | ||||
-rw-r--r-- | gtk/gtkcombobox.h | 3 | ||||
-rw-r--r-- | gtk/gtkcomboboxtext.c | 34 | ||||
-rw-r--r-- | gtk/gtkcomboboxtext.h | 4 |
7 files changed, 5 insertions, 125 deletions
@@ -13,7 +13,6 @@ Overview of Changes from GTK+ 2.91.1 to 2.91.2 - Popups can be wider than the combo box itself - The deprecated GtkComboBoxEntry subclass has been removed - The deprecated combo box text convenience API has been removed - - Numeric IDs can be associated with model values * GtkRecentManager changes: - Store xbel file in XDG_USER_DATA diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt index da659d10c6..e420b4eaf9 100644 --- a/docs/reference/gtk/gtk3-sections.txt +++ b/docs/reference/gtk/gtk3-sections.txt @@ -804,8 +804,6 @@ gtk_combo_box_get_button_sensitivity gtk_combo_box_get_has_entry gtk_combo_box_set_entry_text_column gtk_combo_box_get_entry_text_column -gtk_combo_box_set_id_column -gtk_combo_box_get_id_column <SUBSECTION Standard> GTK_TYPE_COMBO_BOX GTK_COMBO_BOX @@ -825,9 +823,8 @@ GtkComboBoxText gtk_combo_box_text_new gtk_combo_box_text_new_with_entry gtk_combo_box_text_append_text -gtk_combo_box_text_prepend_text gtk_combo_box_text_insert_text -gtk_combo_box_text_insert_text_with_id +gtk_combo_box_text_prepend_text gtk_combo_box_text_remove gtk_combo_box_text_remove_all gtk_combo_box_text_get_active_text diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols index 0ee0e314c5..6a297bb6aa 100644 --- a/gtk/gtk.symbols +++ b/gtk/gtk.symbols @@ -801,7 +801,6 @@ gtk_combo_box_get_column_span_column gtk_combo_box_get_entry_text_column gtk_combo_box_get_focus_on_click gtk_combo_box_get_has_entry -gtk_combo_box_get_id_column gtk_combo_box_get_model gtk_combo_box_get_popup_accessible gtk_combo_box_get_popup_fixed_width @@ -823,7 +822,6 @@ gtk_combo_box_set_add_tearoffs gtk_combo_box_set_column_span_column gtk_combo_box_set_entry_text_column gtk_combo_box_set_focus_on_click -gtk_combo_box_set_id_column gtk_combo_box_set_model gtk_combo_box_set_popup_fixed_width gtk_combo_box_set_row_separator_func @@ -840,7 +838,6 @@ gtk_combo_box_text_append_text gtk_combo_box_text_get_active_text gtk_combo_box_text_get_type G_GNUC_CONST gtk_combo_box_text_insert_text -gtk_combo_box_text_insert_text_with_id gtk_combo_box_text_new gtk_combo_box_text_new_with_entry gtk_combo_box_text_prepend_text diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index 64023569e3..93297921ba 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -143,8 +143,6 @@ struct _GtkComboBoxPrivate gint text_column; GtkCellRenderer *text_renderer; - gint id_column; - GSList *cells; guint popup_in_progress : 1; @@ -247,8 +245,7 @@ enum { PROP_EDITING_CANCELED, PROP_HAS_ENTRY, PROP_ENTRY_TEXT_COLUMN, - PROP_POPUP_FIXED_WIDTH, - PROP_ID_COLUMN + PROP_POPUP_FIXED_WIDTH }; static guint combo_box_signals[LAST_SIGNAL] = {0,}; @@ -952,23 +949,6 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass) GTK_PARAM_READWRITE)); /** - * GtkComboBox:id-column: - * - * The column in the combo box's model that provides numeric - * IDs for the values in the model, if != -1. - * - * Since: 3.0 - */ - g_object_class_install_property (object_class, - PROP_ID_COLUMN, - g_param_spec_int ("id-column", - P_("ID Column"), - P_("The column in the combo box's model that provides " - "numeric IDs for the values in the model"), - -1, G_MAXINT, -1, - GTK_PARAM_READWRITE)); - - /** * GtkComboBox:popup-fixed-width: * * Whether the popup's width should be a fixed width matching the @@ -1097,7 +1077,6 @@ gtk_combo_box_init (GtkComboBox *combo_box) priv->text_column = -1; priv->text_renderer = NULL; - priv->id_column = -1; gtk_combo_box_check_appearance (combo_box); } @@ -1189,10 +1168,6 @@ gtk_combo_box_set_property (GObject *object, gtk_combo_box_set_entry_text_column (combo_box, g_value_get_int (value)); break; - case PROP_ID_COLUMN: - gtk_combo_box_set_id_column (combo_box, g_value_get_int (value)); - break; - default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1270,10 +1245,6 @@ gtk_combo_box_get_property (GObject *object, g_value_set_int (value, priv->text_column); break; - case PROP_ID_COLUMN: - g_value_set_int (value, priv->id_column); - break; - default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -6573,7 +6544,7 @@ gtk_combo_box_get_preferred_height_for_width (GtkWidget *widget, xpad = 2 * (border_width + cell_style->xthickness); ypad = 2 * (border_width + cell_style->ythickness); - } + } size -= but_width; size -= 2 * focus_width; @@ -6602,50 +6573,3 @@ gtk_combo_box_get_preferred_height_for_width (GtkWidget *widget, if (natural_size) *natural_size = nat_height; } - -/** - * gtk_combo_box_set_id_column: - * @combo_box: A #GtkComboBox - * @id_column: A column in @model to get numeric IDs for values from - * - * Sets the model column which @combo_box should use to get numeric IDs - * for values from. The column @id_column in the model of @combo_box - * must be of type %G_TYPE_INT. - * - * Since: 3.0 - */ -void -gtk_combo_box_set_id_column (GtkComboBox *combo_box, - gint id_column) -{ - GtkComboBoxPrivate *priv = combo_box->priv; - GtkTreeModel *model; - - g_return_if_fail (GTK_IS_COMBO_BOX (combo_box)); - - model = gtk_combo_box_get_model (combo_box); - - g_return_if_fail (id_column >= 0); - g_return_if_fail (model == NULL || id_column < gtk_tree_model_get_n_columns (model)); - - priv->id_column = id_column; -} - -/** - * gtk_combo_box_get_id_column: - * @combo_box: A #GtkComboBox - * - * Returns the column which @combo_box is using to get numeric IDs - * for values from. - * - * Return value: A column in the data source model of @combo_box. - * - * Since: 3.0 - */ -gint -gtk_combo_box_get_id_column (GtkComboBox *combo_box) -{ - g_return_val_if_fail (GTK_IS_COMBO_BOX (combo_box), 0); - - return combo_box->priv->id_column; -} diff --git a/gtk/gtkcombobox.h b/gtk/gtkcombobox.h index ac256a7746..c5b6a3c1e0 100644 --- a/gtk/gtkcombobox.h +++ b/gtk/gtkcombobox.h @@ -133,9 +133,6 @@ void gtk_combo_box_popup_for_device (GtkComboBox *combo_box, void gtk_combo_box_popdown (GtkComboBox *combo_box); AtkObject* gtk_combo_box_get_popup_accessible (GtkComboBox *combo_box); -gint gtk_combo_box_get_id_column (GtkComboBox *combo_box); -void gtk_combo_box_set_id_column (GtkComboBox *combo_box, - gint id_column); G_END_DECLS diff --git a/gtk/gtkcomboboxtext.c b/gtk/gtkcomboboxtext.c index d8df72fdf1..db3a4e86aa 100644 --- a/gtk/gtkcomboboxtext.c +++ b/gtk/gtkcomboboxtext.c @@ -72,7 +72,7 @@ gtk_combo_box_text_init (GtkComboBoxText *combo_box) { GtkListStore *store; - store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT); + store = gtk_list_store_new (1, G_TYPE_STRING); gtk_combo_box_set_model (GTK_COMBO_BOX (combo_box), GTK_TREE_MODEL (store)); g_object_unref (store); } @@ -102,7 +102,6 @@ gtk_combo_box_text_new (void) { return g_object_new (GTK_TYPE_COMBO_BOX_TEXT, "entry-text-column", 0, - "id-column", 1, NULL); } @@ -122,7 +121,6 @@ gtk_combo_box_text_new_with_entry (void) return g_object_new (GTK_TYPE_COMBO_BOX_TEXT, "has-entry", TRUE, "entry-text-column", 0, - "id-column", 1, NULL); } @@ -173,27 +171,6 @@ gtk_combo_box_text_insert_text (GtkComboBoxText *combo_box, gint position, const gchar *text) { - gtk_combo_box_text_insert_text_with_id (combo_box, position, text, 0); -} - -/** - * gtk_combo_box_text_insert_text_with_id: - * @combo_box: A #GtkComboBoxText - * @position: An index to insert @text - * @text: A string - * @id: a numeric ID for this value - * - * Inserts @text at @position in the list of strings stored in @combo_box, - * and sets its numeric ID to @id. See #GtkComboBox::id-column. - * - * Since: 3.0 - */ -void -gtk_combo_box_text_insert_text_with_id (GtkComboBoxText *combo_box, - gint position, - const gchar *text, - gint id) -{ GtkListStore *store; GtkTreeIter iter; gint text_column; @@ -209,18 +186,11 @@ gtk_combo_box_text_insert_text_with_id (GtkComboBoxText *combo_box, text_column = gtk_combo_box_get_entry_text_column (GTK_COMBO_BOX (combo_box)); column_type = gtk_tree_model_get_column_type (GTK_TREE_MODEL (store), text_column); g_return_if_fail (column_type == G_TYPE_STRING); - id_column = gtk_combo_box_get_id_column (GTK_COMBO_BOX (combo_box)); - if (id_column != -1) - { - column_type = gtk_tree_model_get_column_type (GTK_TREE_MODEL (store), id_column); - g_return_if_fail (column_type == G_TYPE_INT); - } gtk_list_store_insert (store, &iter, position); - gtk_list_store_set (store, &iter, text_column, text, id_column, id, -1); + gtk_list_store_set (store, &iter, text_column, text, -1); } - /** * gtk_combo_box_text_remove: * @combo_box: A #GtkComboBox diff --git a/gtk/gtkcomboboxtext.h b/gtk/gtkcomboboxtext.h index 7322e45134..50ebcb501c 100644 --- a/gtk/gtkcomboboxtext.h +++ b/gtk/gtkcomboboxtext.h @@ -72,10 +72,6 @@ void gtk_combo_box_text_remove (GtkComboBoxText *combo_box void gtk_combo_box_text_remove_all (GtkComboBoxText *combo_box); gchar *gtk_combo_box_text_get_active_text (GtkComboBoxText *combo_box); -void gtk_combo_box_text_insert_text_with_id (GtkComboBoxText *combo_box, - gint position, - const gchar *text, - gint id); G_END_DECLS |