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 759878 - Let's have sorting based on item creation time
Let's have sorting based on item creation time
Status: RESOLVED FIXED
Product: gnome-todo
Classification: Other
Component: General
3.18.x
Other Linux
: Normal enhancement
: ---
Assigned To: GNOME To Do maintainer(s)
GNOME To Do maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-12-26 14:16 UTC by Mohammed Sadiq
Modified: 2016-02-23 16:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtd-task: Add creation date property (6.25 KB, patch)
2016-02-18 04:00 UTC, Isaque Galdino
none Details | Review
gtd-task: Add creation date property (6.26 KB, patch)
2016-02-23 15:25 UTC, Isaque Galdino
committed Details | Review

Description Mohammed Sadiq 2015-12-26 14:16:58 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.
Comment 1 Isaque Galdino 2016-02-18 04:00:41 UTC
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
Comment 2 Georges Basile Stavracas Neto 2016-02-23 02:08:26 UTC
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()
Comment 3 Isaque Galdino 2016-02-23 15:25:10 UTC
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
Comment 4 Georges Basile Stavracas Neto 2016-02-23 16:35:13 UTC
Attachment 321987 [details] pushed as 506b7dc - gtd-task: Add creation date property