[gnome-todo/gnome-3-22] task-list-view: set the new tasklist before anything else



commit d017b51783af7c932ee123e4276e2c0810717d9b
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Dec 1 00:11:23 2016 -0200

    task-list-view: set the new tasklist before anything else
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773835

 src/gtd-task-list-view.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/gtd-task-list-view.c b/src/gtd-task-list-view.c
index 8c5f799..eadb807 100644
--- a/src/gtd-task-list-view.c
+++ b/src/gtd-task-list-view.c
@@ -1759,7 +1759,6 @@ gtd_task_list_view_set_task_list (GtdTaskListView *view,
   GList *task_list;
 
   g_return_if_fail (GTD_IS_TASK_LIST_VIEW (view));
-  g_return_if_fail (GTD_IS_TASK_LIST (list));
 
   if (priv->task_list == list)
     return;
@@ -1777,6 +1776,15 @@ gtd_task_list_view_set_task_list (GtdTaskListView *view,
                                             view);
     }
 
+  priv->task_list = list;
+
+  if (!list)
+    {
+      gtd_edit_pane_set_task (GTD_EDIT_PANE (priv->edit_pane), NULL);
+      gtd_task_list_view_set_list (view, NULL);
+      return;
+    }
+
   /* Add the color to provider */
   color = gtd_task_list_get_color (list);
   color_str = gdk_rgba_to_string (color);
@@ -1794,9 +1802,6 @@ gtd_task_list_view_set_task_list (GtdTaskListView *view,
   gdk_rgba_free (color);
   g_free (color_str);
 
-  /* Load task */
-  priv->task_list = list;
-
   update_font_color (view);
 
   /* Add the tasks from the list */


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