GNOME Bugzilla – Bug 166450
Sort Tasks in Clock Applet
Last modified: 2005-06-07 15:31:09 UTC
Version details: 2.9.90 Distribution/Version: Fedora Development The Evo tasks shown in the clock applet seem to be in no order whatsoever. Would be nice if they were sortable through a preference.
Please no, not yet another place to configure sorting. There's already two separate preferences in evolution, one for tasks in calendar view and another one for tasks view. Rather I think the clock applet should use the same sorting method as evo does in the calendar view. Even sorting by due date would be nicer than unsorted.
Totally agree. Patches are welcome :-)
Created attachment 45413 [details] [review] Proposed patch I think it's very useful to have the tasks sorted by the priority. This patch sorts the task model by the priority.
Created attachment 45418 [details] [review] Updated patch Sorry, I forgot a stupid debug printf in the first patch.
I think sorting by priority is the way to go too. A few comments on the patch. You should sort in ascending order since http://www.ietf.org/rfc/rfc2445.txt defines PRIORITY as: The priority is specified as an integer in the range zero to nine. A value of zero (US-ASCII decimal 48) specifies an undefined priority. A value of one (US-ASCII decimal 49) is the highest priority. A value of two (US-ASCII decimal 50) is the second highest priority. Subsequent numbers specify a decreasing ordinal priority. A value of nine (US-ASCII decimal 58) is the lowest priority. The highest priority should be sorted to the top of the treeview. Also, an undefined priority (numerical zero) should probably be sorted to the end. So, you should probably set up a custom sort function. We should probably also watch for changes in the priority value and update the model which I don't think we do right now. Or maybe e-d-s isn't giving us a signal.
I think evo gives high values for high priority, and low values for low priority.
Created attachment 46663 [details] [review] patch This should do it.
William: patch looks okay for head :-) Thanks
2005-06-07 William Jon McCann <mccann@jhu.edu> * clock.c (compare_priority, handle_tasks_changed) (create_task_list): * calendar-client.[ch] (get_ical_priority, calendar_task_equal) (calendar_task_copy, calendar_task_init): Sort task list by priority. Based on patch by Carlos Garcia Campos <carlosgc@gnome.org> Fixes #166450.