[gnome-notes] bjb-window: Fix duplicated items in notebook list



commit 9f21ef759315b18dce5d31aa0b58219df105a607
Author: Jonathan Kang <jonathankang gnome org>
Date:   Wed Jul 28 14:46:59 2021 +0800

    bjb-window: Fix duplicated items in notebook list

 src/bjb-window.c | 10 ----------
 1 file changed, 10 deletions(-)
---
diff --git a/src/bjb-window.c b/src/bjb-window.c
index 7e715fb6..8e491f1a 100644
--- a/src/bjb-window.c
+++ b/src/bjb-window.c
@@ -600,8 +600,6 @@ on_display_notebooks_changed (BjbWindow *self)
   gtk_container_foreach (GTK_CONTAINER (self->notebooks_box),
                          (GtkCallback) gtk_widget_destroy, NULL);
 
-  manager = bjb_window_get_manager (GTK_WIDGET (self));
-
   n_items = g_list_model_get_n_items (notebooks);
 
   for (guint i = 0; i < n_items; i++)
@@ -628,10 +626,8 @@ static GActionEntry win_entries[] = {
 static void
 bjb_window_constructed (GObject *obj)
 {
-  BijiManager *manager;
   BjbWindow *self = BJB_WINDOW (obj);
   GtkListBox *list_box;
-  GListModel *notebooks;
   GdkRectangle geometry;
 
   G_OBJECT_CLASS (bjb_window_parent_class)->constructed (obj);
@@ -675,12 +671,6 @@ bjb_window_constructed (GObject *obj)
   gtk_widget_show (GTK_WIDGET (self->main_stack));
 
   /* Populate the filter menu model. */
-  manager = bjb_window_get_manager (GTK_WIDGET (self));
-  notebooks = biji_manager_get_notebooks (manager);
-
-  g_signal_connect_object (notebooks, "items-changed",
-                           G_CALLBACK (on_display_notebooks_changed), self,
-                           G_CONNECT_SWAPPED | G_CONNECT_AFTER);
   on_display_notebooks_changed (self);
 
   /* Connection to window signals */


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