[epiphany] bookmarks-popover: Properly remove bookmark from tag detail



commit fe31197f7dce130ce73fcffc6e086550ced73bbf
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sun Feb 19 16:09:13 2017 -0600

    bookmarks-popover: Properly remove bookmark from tag detail
    
    When a bookmark is removed, we need to also remove it from the tag
    detail.

 src/bookmarks/ephy-bookmarks-popover.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/src/bookmarks/ephy-bookmarks-popover.c b/src/bookmarks/ephy-bookmarks-popover.c
index d3a6b83..e7b45b8 100644
--- a/src/bookmarks/ephy-bookmarks-popover.c
+++ b/src/bookmarks/ephy-bookmarks-popover.c
@@ -279,9 +279,23 @@ ephy_bookmarks_popover_bookmark_removed_cb (EphyBookmarksPopover *self,
       break;
     }
   }
-
   gtk_container_remove (GTK_CONTAINER (self->tags_list_box), row);
 
+  children = gtk_container_get_children (GTK_CONTAINER (self->tag_detail_list_box));
+  for (l = children; l != NULL; l = l->next) {
+    const char *type;
+    const char *url;
+
+    row = GTK_WIDGET (l->data);
+    type = g_object_get_data (G_OBJECT (row), "type");
+    url = g_object_get_data (G_OBJECT (row), "url");
+    if (g_strcmp0 (type, EPHY_LIST_BOX_ROW_TYPE_BOOKMARK) == 0
+        && g_strcmp0 (ephy_bookmark_get_url (bookmark), url) == 0) {
+      break;
+    }
+  }
+  gtk_container_remove (GTK_CONTAINER (self->tag_detail_list_box), row);
+
   if (g_list_model_get_n_items (G_LIST_MODEL (self->list_model)) == 0)
     gtk_stack_set_visible_child_name (GTK_STACK (self->toplevel_stack), "empty-state");
 }


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