GNOME Bugzilla – Bug 593107
users-admin does not sort when Name/Login/Homedir field clicked
Last modified: 2010-01-30 14:57:25 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
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.
If my insomnia kicks in again tonight I'll take a look ;-)
We now longer show headers in 2.29.
Does this mean there will be no way to sort the users or is there some other way?
Gavin: let's comment that on the Launchpad report where I started the discussion with you. ;-)
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.