After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 151139 - Turn off sorting on Gtk*Store after it has been enabled
Turn off sorting on Gtk*Store after it has been enabled
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
2.4.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtktreeview-bugs
gtktreeview-bugs
Depends on:
Blocks:
 
 
Reported: 2004-08-26 16:35 UTC by Torsten Schoenfeld
Modified: 2011-02-04 16:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make it possible to turn off sorting (5.19 KB, patch)
2004-08-26 16:36 UTC, Torsten Schoenfeld
none Details | Review
GtkListStore example (4.32 KB, text/plain)
2004-08-26 16:36 UTC, Torsten Schoenfeld
  Details
GtkTreeStore example (4.84 KB, text/plain)
2004-08-26 16:37 UTC, Torsten Schoenfeld
  Details

Description Torsten Schoenfeld 2004-08-26 16:35:25 UTC
Aloha,

as per the discussion on the list, here's a patch that enables you to turn off
sorting again by officially blessing the magical sort column value that denotes
an unsorted store and by removing/adjusting some assertions.

Also attached are two sample applications.  When you click on a column heading,
the sorting mode changes to ascending, descending or none, depending on the
current mode.  Activating a row adds a new row, to test/demonstrate whether new
rows get sorted correctly.

Bye,
-Torsten
Comment 1 Torsten Schoenfeld 2004-08-26 16:36:19 UTC
Created attachment 30979 [details] [review]
Make it possible to turn off sorting
Comment 2 Torsten Schoenfeld 2004-08-26 16:36:47 UTC
Created attachment 30980 [details]
GtkListStore example
Comment 3 Torsten Schoenfeld 2004-08-26 16:37:04 UTC
Created attachment 30981 [details]
GtkTreeStore example
Comment 4 Matthias Clasen 2004-09-05 05:06:16 UTC
Sun Sep  5 01:04:01 2004  Matthias Clasen  <maclas@gmx.de>

	Allow sorting of tree models to be turned off 
	again.  (#151139, Torsten Schoenfeld)
	
	* gtk/gtktreesortable.h: 
	Add GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.

	* gtk/gtktreestore.c (gtk_tree_store_sort): 
	* gtk/gtkliststore.c (gtk_list_store_sort): Don't sort if
	the list store is not sorted.