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 593107 - users-admin does not sort when Name/Login/Homedir field clicked
users-admin does not sort when Name/Login/Homedir field clicked
Status: RESOLVED OBSOLETE
Product: gnome-system-tools
Classification: Deprecated
Component: users-admin
CVS latest
Other Linux
: Normal normal
: ---
Assigned To: Carlos Garnacho
Carlos Garnacho
Depends on:
Blocks:
 
 
Reported: 2009-08-26 02:25 UTC by Gavin McCullagh
Modified: 2010-01-30 14:57 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Gavin McCullagh 2009-08-26 02:25:47 UTC
If you have a lot of users on your system (eg on an LTSP install), the users-admin tool quickly becomes very tedious to use.  The names are sorted arbitrarily (presumably the order which the perl code in system-tools-backend returns them and clicking on the list headings doesn't sort by that field. 

If you click on the Name column you get:

(users-admin:600): GLib-GObject-WARNING **: invalid cast from `GtkTreeModelFilter' to `GtkTreeSortable'

(users-admin:600): Gtk-CRITICAL **: gtk_tree_sortable_get_sort_column_id: assertion `GTK_IS_TREE_SORTABLE (sortable)' failed

(users-admin:600): GLib-GObject-WARNING **: invalid cast from `GtkTreeModelFilter' to `GtkTreeSortable'

(users-admin:600): Gtk-CRITICAL **: gtk_tree_sortable_has_default_sort_func: assertion `GTK_IS_TREE_SORTABLE (sortable)' failed

(users-admin:600): GLib-GObject-WARNING **: invalid cast from `GtkTreeModelFilter' to `GtkTreeSortable'

(users-admin:600): Gtk-CRITICAL **: gtk_tree_sortable_set_sort_column_id: assertion `GTK_IS_TREE_SORTABLE (sortable)' failed

Apparently a GtkTreeModelFilter is in use in order to omit the columns containing system users (commonly uid>0 && uid<1000).  It seems that GtkTreeModelFilter may not be sortable.

More details are on the Ubuntu bug in launchpad
https://bugs.launchpad.net/ubuntu/+source/gnome-system-tools/+bug/259163
Comment 1 Milan Bouchet-Valat 2009-08-26 09:23:59 UTC
Thanks for investigating that. The mail you linked to in Launchpad says that it's actually possible to use GtkTreeModelFilter with sorting functions. I guess we need to use gtk_tree_model_sort_new_with_model() passing the GtkTreeModelFilter has model, and then set the sort columns, etc. Just a guess, though.

Would you take a look at that? You can find the relevant code in src/users/, in files users-table.c, table.c, and possibly callbacks.c. I can help if needed.
Comment 2 Gavin McCullagh 2009-08-26 12:17:54 UTC
If my insomnia kicks in again tonight I'll take a look ;-)
Comment 3 Milan Bouchet-Valat 2010-01-19 10:43:18 UTC
We now longer show headers in 2.29.
Comment 4 Gavin McCullagh 2010-01-19 10:47:22 UTC
Does this mean there will be no way to sort the users or is there some other way?
Comment 5 Milan Bouchet-Valat 2010-01-19 10:56:26 UTC
Gavin: let's comment that on the Launchpad report where I started the discussion with you. ;-)
Comment 6 Milan Bouchet-Valat 2010-01-30 14:57:25 UTC
Just pushed a fix so that users are sorting according to their login, and typeahead column is the login, because that's what admins with large user bases will want to use.