[gnome-todo] unscheduled-panel: fix task loss issue



commit b71faa9865a0ba3a2b910fc42c83f65d753bfd2e
Author: Monica Baluna <monicamariabaluna gmail com>
Date:   Wed Mar 1 15:42:10 2017 +0200

    unscheduled-panel: fix task loss issue
    
    The tasklist used by the unscheduled panel does not have an associated provider.
    This generates an error when attempting to create a task. In order to fix this,
    do not explicitly set a task list for the view. In this way, the default
    provider will be used, just like in the other plugins.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773836

 .../unscheduled-panel/__init__.py                  |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/plugins/unscheduled-panel/unscheduled-panel/__init__.py 
b/plugins/unscheduled-panel/unscheduled-panel/__init__.py
index 5853819..b6c87ca 100644
--- a/plugins/unscheduled-panel/unscheduled-panel/__init__.py
+++ b/plugins/unscheduled-panel/unscheduled-panel/__init__.py
@@ -42,12 +42,10 @@ class UnscheduledPanel(Gtk.Box, Gtd.Panel):
         manager.connect('list-removed', self._count_tasks)
 
         self.task_counter = 0
-        self.tasklist = Gtd.TaskList()
 
         self.view = Gtd.TaskListView(hexpand=True,
                                      vexpand=True)
         self.view.set_show_list_name(True)
-        self.view.set_task_list(self.tasklist)
         self.view.set_handle_subtasks(False)
 
         self.add(self.view)
@@ -61,16 +59,17 @@ class UnscheduledPanel(Gtk.Box, Gtd.Panel):
         self.task_counter = 0
 
         manager = Gtd.Manager.get_default()
-        current_tasks = self.tasklist.get_tasks()
+        current_tasks = []
 
         for tasklist in manager.get_task_lists():
             for task in tasklist.get_tasks():
                 if task.get_due_date() is None:
-                    if not task in current_tasks:
-                        self.tasklist.save_task(task)
+                    current_tasks.append(task)
                     if not task.get_complete():
                         self.task_counter += 1
 
+        self.view.set_list(current_tasks)
+
         if previous_task_counter != self.task_counter:
             self.notify("title")
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]