GNOME Bugzilla – Bug 759878
Let's have sorting based on item creation time
Last modified: 2016-02-23 16:35:17 UTC
Right now, the list is sorted in alphabetical order. Along with, it would be better to have an option to sort the list based on creation time, ascending and descending.
Created attachment 321558 [details] [review] gtd-task: Add creation date property It was requested to add another sort by creation time. gtd-task didn't keep record of that information, so it was necessary to add a new property to handle that. EDS prevents creation time field to be updated by the user agent, so it was added only a method to recover that information and not to set it. It was also noticed during some tests that some services like Google don't return a sane creation time. That seems to be a problem between EDS and Google. This commit also changes the sorting order: - Standard Order: complete > priority > due-date > creation-date > title - Scheduled Panel Order: due-date > completed > priority > creation-date > title
Review of attachment 321558 [details] [review]: The patch looks mostly good, besides some nitpicks (i'm really a nitpicker). Although the code is correct, seems like Evo-Data-Server puts the ::creation-date property almost in an undefined state (I really couldn't predict the results) - but I guess this is something for another bug. ::: src/gtd-task.c @@ +525,3 @@ + e_cal_component_get_created (priv->component, &idt); + + dt = NULL; Put this line below 'idt = NULL'. As a rule of thumb, for To Do codebase, try to declare as much variables as you can between the vfail check and functions. @@ +529,3 @@ + { + dt = gtd_task__convert_icaltime (idt); + e_cal_component_free_icaltimetype (idt); Use g_clear_pointer (&idt, e_cal_component_free_icaltimetype) @@ +530,3 @@ + dt = gtd_task__convert_icaltime (idt); + e_cal_component_free_icaltimetype (idt); + } Make this if() a one-line check by using g_clear_pointer()
Created attachment 321987 [details] [review] gtd-task: Add creation date property It was requested to add another sort by creation time. gtd-task didn't keep record of that information, so it was necessary to add a new property to handle that. EDS prevents creation time field to be updated by the user agent, so it was added only a method to recover that information and not to set it. It was also noticed during some tests that some services like Google don't return a sane creation time. That seems to be a problem between EDS and Google. This commit also changes the sorting order: - Standard Order: complete > priority > due-date > creation-date > title - Scheduled Panel Order: due-date > completed > priority > creation-date > title
Attachment 321987 [details] pushed as 506b7dc - gtd-task: Add creation date property