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
=== modified file 'GTG/core/task.py'
--- GTG/core/task.py 2012-03-30 12:58:10 +0000
+++ GTG/core/task.py 2012-04-06 13:04:21 +0000
@@ -266,6 +266,18 @@
266266
267 return zedate267 return zedate
268268
269 #When sort by due date, we want to display the task with earliest due date(include subtasks) first
270 def get_due_date_of_self_and_all_subtasks(self):
271 zedate = self.due_date
272
273 for sub in self.get_subtasks():
274 subdate = sub.get_due_date()
275 if subdate and zedate > subdate:
276 zedate = subdate
277
278 return zedate
279
280
269 def set_start_date(self, fulldate):281 def set_start_date(self, fulldate):
270 self.start_date = Date(fulldate)282 self.start_date = Date(fulldate)
271 self.sync()283 self.sync()
272284
=== modified file 'GTG/gtk/browser/treeview_factory.py'
--- GTG/gtk/browser/treeview_factory.py 2012-03-27 10:46:47 +0000
+++ GTG/gtk/browser/treeview_factory.py 2012-04-06 13:04:21 +0000
@@ -172,8 +172,8 @@
172 t1 = task1.get_start_date()172 t1 = task1.get_start_date()
173 t2 = task2.get_start_date()173 t2 = task2.get_start_date()
174 elif para == 'due':174 elif para == 'due':
175 t1 = task1.get_due_date()175 t1 = task1.get_due_date_of_self_and_all_subtasks()
176 t2 = task2.get_due_date()176 t2 = task2.get_due_date_of_self_and_all_subtasks()
177 elif para == 'closed':177 elif para == 'closed':
178 t1 = task1.get_closed_date()178 t1 = task1.get_closed_date()
179 t2 = task2.get_closed_date()179 t2 = task2.get_closed_date()

Subscribers

People subscribed via source and target branches

to status/vote changes: