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 166450 - Sort Tasks in Clock Applet
Sort Tasks in Clock Applet
Status: RESOLVED FIXED
Product: gnome-panel
Classification: Other
Component: clock
2.9.x
Other Linux
: Normal enhancement
: ---
Assigned To: Panel Maintainers
Panel Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-02-06 14:53 UTC by Ryan P Skadberg
Modified: 2005-06-07 15:31 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
Proposed patch (4.97 KB, patch)
2005-04-18 20:55 UTC, Carlos Garcia Campos
none Details | Review
Updated patch (4.50 KB, patch)
2005-04-18 22:06 UTC, Carlos Garcia Campos
needs-work Details | Review
patch (6.60 KB, patch)
2005-05-19 22:11 UTC, William Jon McCann
committed Details | Review

Description Ryan P Skadberg 2005-02-06 14:53:25 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.
Comment 1 Tommi Komulainen 2005-03-23 08:41:01 UTC
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.
Comment 2 Vincent Untz 2005-03-23 19:37:46 UTC
Totally agree. Patches are welcome :-)
Comment 3 Carlos Garcia Campos 2005-04-18 20:55:33 UTC
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.
Comment 4 Carlos Garcia Campos 2005-04-18 22:06:35 UTC
Created attachment 45418 [details] [review]
Updated patch

Sorry, I forgot a stupid debug printf in the first patch.
Comment 5 William Jon McCann 2005-05-04 22:18:33 UTC
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.
Comment 6 Carlos Garcia Campos 2005-05-05 16:11:55 UTC
I think evo gives high values for high priority, and low values for low priority.
Comment 7 William Jon McCann 2005-05-19 22:11:00 UTC
Created attachment 46663 [details] [review]
patch

This should do it.
Comment 8 Vincent Untz 2005-06-06 22:14:04 UTC
William: patch looks okay for head :-)
Thanks
Comment 9 William Jon McCann 2005-06-07 15:31:09 UTC
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.