#59173: patch



Hi,

Attached patch fixes bug 59173 (TreeView code should use GtkSortType
instead of GtkTreeSortOrder).

Ok to commit?

regards,


	Kris

-- 
Odi et amo. Quare id faciam, fortasse requiris?
	Nescio, sed fieri sentio et excrucior.

-Catullus (Carmen 85)
Index: gtk+//ChangeLog
===================================================================
RCS file: /cvs/gnome/gtk+/ChangeLog,v
retrieving revision 1.2203
diff -u -r1.2203 ChangeLog
--- gtk+//ChangeLog	2001/08/23 16:54:47	1.2203
+++ gtk+//ChangeLog	2001/08/23 18:07:49
@@ -1,3 +1,10 @@
+Thu Aug 23 20:01:41 2001  Kristian Rietveld  <kristian planet nl>
+
+	* gtk/gtktreemodelsort.[ch], gtk/gtktreesortable.[ch],
+	gtk/gtktreestore.[ch], gtk/gtktreeviewcolumn.[ch],
+	gtk/gtkliststore.[ch]: use GtkSortType instead of GtkTreeSortOrder.
+	(#59173).
+
 Thu Aug 23 16:26:47 2001  Tim Janik  <timj gtk org>
 
 	* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_finalize): 
Index: gtk+//gtk/gtkliststore.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkliststore.c,v
retrieving revision 1.46
diff -u -r1.46 gtkliststore.c
--- gtk+//gtk/gtkliststore.c	2001/08/19 23:46:59	1.46
+++ gtk+//gtk/gtkliststore.c	2001/08/23 18:08:04
@@ -95,10 +95,10 @@
 						   gint                    column);
 static gboolean gtk_list_store_get_sort_column_id (GtkTreeSortable        *sortable,
 						   gint                   *sort_column_id,
-						   GtkTreeSortOrder       *order);
+						   GtkSortType            *order);
 static void     gtk_list_store_set_sort_column_id (GtkTreeSortable        *sortable,
 						   gint                    sort_column_id,
-						   GtkTreeSortOrder        order);
+						   GtkSortType             order);
 static void     gtk_list_store_set_sort_func      (GtkTreeSortable        *sortable,
 						   gint                    sort_column_id,
 						   GtkTreeIterCompareFunc  func,
@@ -1391,7 +1391,7 @@
 			     &iter_a, &iter_b,
 			     header->data);
 
-  if (list_store->order == GTK_TREE_SORT_DESCENDING)
+  if (list_store->order == GTK_SORT_DESCENDING)
     {
       if (retval > 0)
 	retval = -1;
@@ -1530,7 +1530,7 @@
     }
 
 
-  if (list_store->order == GTK_TREE_SORT_DESCENDING)
+  if (list_store->order == GTK_SORT_DESCENDING)
     {
       if (cmp_a < 0)
 	cmp_a = 1;
@@ -1567,7 +1567,7 @@
   list = G_SLIST (list_store->root);
   new_location = 0;
   tmp_iter.user_data = list;
-  if (list_store->order == GTK_TREE_SORT_DESCENDING)
+  if (list_store->order == GTK_SORT_DESCENDING)
     cmp_a = (* header->func) (GTK_TREE_MODEL (list_store),
 			      &tmp_iter, iter, header->data);
   else
@@ -1580,7 +1580,7 @@
       list = list->next;
       new_location++;
       tmp_iter.user_data = list;
-      if (list_store->order == GTK_TREE_SORT_DESCENDING)
+      if (list_store->order == GTK_SORT_DESCENDING)
 	cmp_a = (* header->func) (GTK_TREE_MODEL (list_store),
 				  &tmp_iter, iter, header->data);
       else
@@ -1645,7 +1645,7 @@
 static gboolean
 gtk_list_store_get_sort_column_id (GtkTreeSortable  *sortable,
 				   gint             *sort_column_id,
-				   GtkTreeSortOrder *order)
+				   GtkSortType      *order)
 {
   GtkListStore *list_store = (GtkListStore *) sortable;
 
@@ -1664,7 +1664,7 @@
 static void
 gtk_list_store_set_sort_column_id (GtkTreeSortable  *sortable,
 				   gint              sort_column_id,
-				   GtkTreeSortOrder  order)
+				   GtkSortType       order)
 {
   GtkListStore *list_store = (GtkListStore *) sortable;
   GList *list;
Index: gtk+//gtk/gtkliststore.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkliststore.h,v
retrieving revision 1.18
diff -u -r1.18 gtkliststore.h
--- gtk+//gtk/gtkliststore.h	2001/08/22 13:33:58	1.18
+++ gtk+//gtk/gtkliststore.h	2001/08/23 18:08:07
@@ -48,7 +48,7 @@
   GList *sort_list;
   gint n_columns;
   gint sort_column_id;
-  GtkTreeSortOrder order;
+  GtkSortType order;
   GType *column_headers;
   gint length;
 };
Index: gtk+//gtk/gtktreemodelsort.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreemodelsort.c,v
retrieving revision 1.27
diff -u -r1.27 gtktreemodelsort.c
--- gtk+//gtk/gtktreemodelsort.c	2001/07/18 23:39:24	1.27
+++ gtk+//gtk/gtktreemodelsort.c	2001/08/23 18:08:13
@@ -112,10 +112,10 @@
 /* sortable */
 static gboolean gtk_tree_model_sort_get_sort_column_id (GtkTreeSortable        *sortable,
 							gint                   *sort_column_id,
-							GtkTreeSortOrder       *order);
+							GtkSortType            *order);
 static void     gtk_tree_model_sort_set_sort_column_id (GtkTreeSortable        *sortable,
 							gint                    sort_column_id,
-							GtkTreeSortOrder        order);
+							GtkSortType             order);
 static void     gtk_tree_model_sort_set_sort_func      (GtkTreeSortable        *sortable,
 							gint                    sort_column_id,
 							GtkTreeIterCompareFunc  func,
@@ -913,7 +913,7 @@
 static gboolean
 gtk_tree_model_sort_get_sort_column_id (GtkTreeSortable  *sortable,
 					gint             *sort_column_id,
-					GtkTreeSortOrder *order)
+					GtkSortType      *order)
 {
   GtkTreeModelSort *tree_model_sort = (GtkTreeModelSort *) sortable;
 
@@ -933,7 +933,7 @@
 static void
 gtk_tree_model_sort_set_sort_column_id (GtkTreeSortable  *sortable,
 					 gint              sort_column_id,
-					 GtkTreeSortOrder  order)
+					 GtkSortType       order)
 {
   GtkTreeModelSort *tree_model_sort = (GtkTreeModelSort *) sortable;
   GList *list;
Index: gtk+//gtk/gtktreemodelsort.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreemodelsort.h,v
retrieving revision 1.11
diff -u -r1.11 gtktreemodelsort.h
--- gtk+//gtk/gtktreemodelsort.h	2001/06/14 23:25:50	1.11
+++ gtk+//gtk/gtktreemodelsort.h	2001/08/23 18:08:14
@@ -53,7 +53,7 @@
   /* sort information */
   GList *sort_list;
   gint sort_column_id;
-  GtkTreeSortOrder order;
+  GtkSortType order;
 
   /* signal ids */
   guint changed_id;
Index: gtk+//gtk/gtktreesortable.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreesortable.c,v
retrieving revision 1.5
diff -u -r1.5 gtktreesortable.c
--- gtk+//gtk/gtktreesortable.c	2001/07/18 23:39:24	1.5
+++ gtk+//gtk/gtktreesortable.c	2001/08/23 18:08:14
@@ -79,7 +79,7 @@
 gboolean
 gtk_tree_sortable_get_sort_column_id (GtkTreeSortable  *sortable,
 				      gint             *sort_column_id,
-				      GtkTreeSortOrder *order)
+				      GtkSortType      *order)
 {
   GtkTreeSortableIface *iface;
 
@@ -96,7 +96,7 @@
 void
 gtk_tree_sortable_set_sort_column_id (GtkTreeSortable  *sortable,
 				      gint              sort_column_id,
-				      GtkTreeSortOrder  order)
+				      GtkSortType       order)
 {
   GtkTreeSortableIface *iface;
 
Index: gtk+//gtk/gtktreesortable.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreesortable.h,v
retrieving revision 1.6
diff -u -r1.6 gtktreesortable.h
--- gtk+//gtk/gtktreesortable.h	2001/06/15 23:03:26	1.6
+++ gtk+//gtk/gtktreesortable.h	2001/08/23 18:08:15
@@ -26,12 +26,6 @@
 extern "C" {
 #endif /* __cplusplus */
 
-typedef enum
-{
-  GTK_TREE_SORT_ASCENDING,
-  GTK_TREE_SORT_DESCENDING
-} GtkTreeSortOrder;
-
 #define GTK_TYPE_TREE_SORTABLE            (gtk_tree_sortable_get_type ())
 #define GTK_TREE_SORTABLE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TREE_SORTABLE, GtkTreeSortable))
 #define GTK_TREE_SORTABLE_CLASS(obj)      (G_TYPE_CHECK_CLASS_CAST ((obj), GTK_TYPE_TREE_SORTABLE, GtkTreeSortableIface))
@@ -58,10 +52,10 @@
   /* virtual table */
   gboolean (* get_sort_column_id) (GtkTreeSortable  *sortable,
 				   gint             *sort_column_id,
-				   GtkTreeSortOrder *order);
+				   GtkSortType      *order);
   void (* set_sort_column_id)     (GtkTreeSortable  *sortable,
 				   gint              sort_column_id,
-				   GtkTreeSortOrder  order);
+				   GtkSortType       order);
   void (* set_sort_func)          (GtkTreeSortable  *sortable,
 				   gint              sort_column_id,
 				   GtkTreeIterCompareFunc func,
@@ -75,10 +69,10 @@
 void     gtk_tree_sortable_sort_column_changed (GtkTreeSortable        *sortable);
 gboolean gtk_tree_sortable_get_sort_column_id  (GtkTreeSortable        *sortable,
 						gint                   *sort_column_id,
-						GtkTreeSortOrder       *order);
+						GtkSortType            *order);
 void     gtk_tree_sortable_set_sort_column_id  (GtkTreeSortable        *sortable,
 						gint                    sort_column_id,
-						GtkTreeSortOrder        order);
+						GtkSortType             order);
 void     gtk_tree_sortable_set_sort_func       (GtkTreeSortable        *sortable,
 						gint                    sort_column_id,
 						GtkTreeIterCompareFunc  func,
Index: gtk+//gtk/gtktreestore.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreestore.c,v
retrieving revision 1.43
diff -u -r1.43 gtktreestore.c
--- gtk+//gtk/gtktreestore.c	2001/08/08 07:42:21	1.43
+++ gtk+//gtk/gtktreestore.c	2001/08/23 18:08:22
@@ -94,10 +94,10 @@
 							gint                    column);
 static gboolean gtk_tree_store_get_sort_column_id      (GtkTreeSortable        *sortable,
 							gint                   *sort_column_id,
-							GtkTreeSortOrder       *order);
+							GtkSortType            *order);
 static void     gtk_tree_store_set_sort_column_id      (GtkTreeSortable        *sortable,
 							gint                    sort_column_id,
-							GtkTreeSortOrder        order);
+							GtkSortType             order);
 static void     gtk_tree_store_set_sort_func (GtkTreeSortable        *sortable,
 							gint                    sort_column_id,
 							GtkTreeIterCompareFunc  func,
@@ -1490,7 +1490,7 @@
 			     &iter_a, &iter_b,
 			     header->data);
 
-  if (tree_store->order == GTK_TREE_SORT_DESCENDING)
+  if (tree_store->order == GTK_SORT_DESCENDING)
     {
       if (retval > 0)
 	retval = -1;
@@ -1653,7 +1653,7 @@
     }
 
 
-  if (tree_store->order == GTK_TREE_SORT_DESCENDING)
+  if (tree_store->order == GTK_SORT_DESCENDING)
     {
       if (cmp_a < 0)
 	cmp_a = 1;
@@ -1692,7 +1692,7 @@
   node = node->parent->children;
   new_location = 0;
   tmp_iter.user_data = node;
-  if (tree_store->order == GTK_TREE_SORT_DESCENDING)
+  if (tree_store->order == GTK_SORT_DESCENDING)
     cmp_a = (* header->func) (GTK_TREE_MODEL (tree_store),
 			      &tmp_iter, iter, header->data);
   else
@@ -1705,7 +1705,7 @@
       node = node->next;
       new_location++;
       tmp_iter.user_data = node;
-      if (tree_store->order == GTK_TREE_SORT_DESCENDING)
+      if (tree_store->order == GTK_SORT_DESCENDING)
 	cmp_a = (* header->func) (GTK_TREE_MODEL (tree_store),
 				  &tmp_iter, iter, header->data);
       else
@@ -1774,7 +1774,7 @@
 static gboolean
 gtk_tree_store_get_sort_column_id (GtkTreeSortable  *sortable,
 				   gint             *sort_column_id,
-				   GtkTreeSortOrder *order)
+				   GtkSortType      *order)
 {
   GtkTreeStore *tree_store = (GtkTreeStore *) sortable;
 
@@ -1794,7 +1794,7 @@
 static void
 gtk_tree_store_set_sort_column_id (GtkTreeSortable  *sortable,
 				   gint              sort_column_id,
-				   GtkTreeSortOrder  order)
+				   GtkSortType       order)
 {
   GtkTreeStore *tree_store = (GtkTreeStore *) sortable;
   GList *list;
Index: gtk+//gtk/gtktreestore.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreestore.h,v
retrieving revision 1.20
diff -u -r1.20 gtktreestore.h
--- gtk+//gtk/gtktreestore.h	2001/06/30 21:15:27	1.20
+++ gtk+//gtk/gtktreestore.h	2001/08/23 18:08:23
@@ -48,7 +48,7 @@
   gint n_columns;
   gint sort_column_id;
   GList *sort_list;
-  GtkTreeSortOrder order;
+  GtkSortType order;
   GType *column_headers;
 };
 
Index: gtk+//gtk/gtktreeviewcolumn.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreeviewcolumn.c,v
retrieving revision 1.60
diff -u -r1.60 gtktreeviewcolumn.c
--- gtk+//gtk/gtktreeviewcolumn.c	2001/08/23 16:54:49	1.60
+++ gtk+//gtk/gtktreeviewcolumn.c	2001/08/23 18:08:33
@@ -268,8 +268,8 @@
                                    g_param_spec_enum ("sort_order",
                                                       _("Sort order"),
                                                       _("Sort direction the sort indicator should indicate"),
-                                                      GTK_TYPE_TREE_SORT_ORDER,
-                                                      GTK_TREE_SORT_ASCENDING,
+                                                      GTK_TYPE_SORT_TYPE,
+                                                      GTK_SORT_ASCENDING,
                                                       G_PARAM_READABLE | G_PARAM_WRITABLE));
   
 }
@@ -287,7 +287,7 @@
   tree_column->visible = TRUE;
   tree_column->clickable = FALSE;
   tree_column->dirty = TRUE;
-  tree_column->sort_order = GTK_TREE_SORT_ASCENDING;
+  tree_column->sort_order = GTK_SORT_ASCENDING;
   tree_column->show_sort_indicator = FALSE;
   tree_column->property_changed_signal = 0;
   tree_column->sort_clicked_signal = 0;
@@ -599,13 +599,13 @@
 
   switch (tree_column->sort_order)
     {
-    case GTK_TREE_SORT_ASCENDING:
+    case GTK_SORT_ASCENDING:
       gtk_arrow_set (GTK_ARROW (arrow),
 		     GTK_ARROW_DOWN,
 		     GTK_SHADOW_IN);
       break;
 
-    case GTK_TREE_SORT_DESCENDING:
+    case GTK_SORT_DESCENDING:
       gtk_arrow_set (GTK_ARROW (arrow),
 		     GTK_ARROW_UP,
 		     GTK_SHADOW_IN);
@@ -764,7 +764,7 @@
 					  GtkTreeViewColumn *column)
 {
   gint sort_column_id;
-  GtkTreeSortOrder order;
+  GtkSortType order;
 
   if (gtk_tree_sortable_get_sort_column_id (sortable,
 					    &sort_column_id,
@@ -792,14 +792,14 @@
 
   if (tree_column->show_sort_indicator)
     {
-      if (tree_column->sort_order == GTK_TREE_SORT_ASCENDING)
-	gtk_tree_view_column_set_sort_order (tree_column, GTK_TREE_SORT_DESCENDING);
+      if (tree_column->sort_order == GTK_SORT_ASCENDING)
+	gtk_tree_view_column_set_sort_order (tree_column, GTK_SORT_DESCENDING);
       else
-	gtk_tree_view_column_set_sort_order (tree_column, GTK_TREE_SORT_ASCENDING);
+	gtk_tree_view_column_set_sort_order (tree_column, GTK_SORT_ASCENDING);
     }
   else
     {
-      gtk_tree_view_column_set_sort_order (tree_column, GTK_TREE_SORT_ASCENDING);
+      gtk_tree_view_column_set_sort_order (tree_column, GTK_SORT_ASCENDING);
       gtk_tree_view_column_set_sort_indicator (tree_column, TRUE);
     }
 
@@ -839,7 +839,7 @@
       tree_column->sort_column_id != -1)
     {
       gint real_sort_column_id;
-      GtkTreeSortOrder real_order;
+      GtkSortType real_order;
 
       if (tree_column->sort_column_changed_signal == 0)
 	tree_column->sort_column_changed_signal =
@@ -1883,7 +1883,7 @@
 	  tree_column->sort_column_changed_signal = 0;
 	}
 
-      gtk_tree_view_column_set_sort_order (tree_column, GTK_TREE_SORT_ASCENDING);
+      gtk_tree_view_column_set_sort_order (tree_column, GTK_SORT_ASCENDING);
       gtk_tree_view_column_set_sort_indicator (tree_column, FALSE);
       return;
     }
@@ -1978,7 +1978,7 @@
  **/
 void
 gtk_tree_view_column_set_sort_order      (GtkTreeViewColumn     *tree_column,
-                                          GtkTreeSortOrder       order)
+                                          GtkSortType            order)
 {
   g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
 
@@ -1998,7 +1998,7 @@
  * 
  * Return value: the sort order the sort indicator is indicating
  **/
-GtkTreeSortOrder
+GtkSortType
 gtk_tree_view_column_get_sort_order      (GtkTreeViewColumn     *tree_column)
 {
   g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
Index: gtk+//gtk/gtktreeviewcolumn.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreeviewcolumn.h,v
retrieving revision 1.36
diff -u -r1.36 gtktreeviewcolumn.h
--- gtk+//gtk/gtktreeviewcolumn.h	2001/08/19 04:19:56	1.36
+++ gtk+//gtk/gtktreeviewcolumn.h	2001/08/23 18:08:35
@@ -85,7 +85,7 @@
   guint sort_clicked_signal;
   guint sort_column_changed_signal;
   gint sort_column_id;
-  GtkTreeSortOrder sort_order;
+  GtkSortType sort_order;
 
   /* Flags */
   guint visible             : 1;
@@ -188,8 +188,8 @@
 								  gboolean                 setting);
 gboolean                gtk_tree_view_column_get_sort_indicator  (GtkTreeViewColumn       *tree_column);
 void                    gtk_tree_view_column_set_sort_order      (GtkTreeViewColumn       *tree_column,
-								  GtkTreeSortOrder         order);
-GtkTreeSortOrder        gtk_tree_view_column_get_sort_order      (GtkTreeViewColumn       *tree_column);
+								  GtkSortType              order);
+GtkSortType             gtk_tree_view_column_get_sort_order      (GtkTreeViewColumn       *tree_column);
 
 
 /* These functions are meant primarily for interaction between the GtkTreeView and the column.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]