GTG

Merge lp:~gosteven/gtg/fix-816356 into lp:~gtg/gtg/old-trunk

Proposed by Steven You
Status: Rejected
Rejected by: Izidor Matušov
Proposed branch: lp:~gosteven/gtg/fix-816356
Merge into: lp:~gtg/gtg/old-trunk
Diff against target: 37 lines (+14/-2)
2 files modified
GTG/core/task.py (+12/-0)
GTG/gtk/browser/treeview_factory.py (+2/-2)
To merge this branch: bzr merge lp:~gosteven/gtg/fix-816356
Reviewer Review Type Date Requested Status
Izidor Matušov Disapprove
Luca Invernizzi Pending
Review via email: mp+101099@code.launchpad.net

Description of the change

Fix bug #816356, when sorting the tasks by due date in tasksbrowser, it should compare the due date of the closest child tasks.

To post a comment you must log in.
Revision history for this message
Izidor Matušov (izidor) wrote :

Thanks for a patch. However, your solution doesn't work for this scenario:

a (due next week)
b (due next month)
 - c (due tomorrow)

After applying your patch I would expect to have [when sorting by due date, close dates first]

b (due next month)
 -c (due tomorrow)
a (due next week)

(b's due date should be replaced by c's tomorrow)

review: Needs Fixing
Revision history for this message
Izidor Matušov (izidor) wrote :

Rejecting for inactivity. If you rework your patch, we will be glad to review it again.

review: Disapprove

Unmerged revisions

1151. By Steven You

Fix bug#816356, when sorting by due-date in taskbrowser, use the closest date of all children. Added a function in task.py: get_due_date_of_self_and_all_subtasks()

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'GTG/core/task.py'
2--- GTG/core/task.py 2012-03-30 12:58:10 +0000
3+++ GTG/core/task.py 2012-04-06 13:04:21 +0000
4@@ -266,6 +266,18 @@
5
6 return zedate
7
8+ #When sort by due date, we want to display the task with earliest due date(include subtasks) first
9+ def get_due_date_of_self_and_all_subtasks(self):
10+ zedate = self.due_date
11+
12+ for sub in self.get_subtasks():
13+ subdate = sub.get_due_date()
14+ if subdate and zedate > subdate:
15+ zedate = subdate
16+
17+ return zedate
18+
19+
20 def set_start_date(self, fulldate):
21 self.start_date = Date(fulldate)
22 self.sync()
23
24=== modified file 'GTG/gtk/browser/treeview_factory.py'
25--- GTG/gtk/browser/treeview_factory.py 2012-03-27 10:46:47 +0000
26+++ GTG/gtk/browser/treeview_factory.py 2012-04-06 13:04:21 +0000
27@@ -172,8 +172,8 @@
28 t1 = task1.get_start_date()
29 t2 = task2.get_start_date()
30 elif para == 'due':
31- t1 = task1.get_due_date()
32- t2 = task2.get_due_date()
33+ t1 = task1.get_due_date_of_self_and_all_subtasks()
34+ t2 = task2.get_due_date_of_self_and_all_subtasks()
35 elif para == 'closed':
36 t1 = task1.get_closed_date()
37 t2 = task2.get_closed_date()

Subscribers

People subscribed via source and target branches

to status/vote changes: