[epiphany] bookmarks-popover: Restore bookmarks to tag view listbox when needed



commit cd930a9c134f21ed8a8b18340168156f448f45c9
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Mon Jan 23 21:40:14 2017 -0600

    bookmarks-popover: Restore bookmarks to tag view listbox when needed
    
    If a bookmark is removed from the tag view listbox while the listbox is
    shown, then restored, it never comes back. Fix this.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=772131

 src/bookmarks/ephy-bookmarks-popover.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/bookmarks/ephy-bookmarks-popover.c b/src/bookmarks/ephy-bookmarks-popover.c
index 0717a08..c8ceede 100644
--- a/src/bookmarks/ephy-bookmarks-popover.c
+++ b/src/bookmarks/ephy-bookmarks-popover.c
@@ -72,6 +72,7 @@ ephy_bookmarks_popover_bookmark_tag_added_cb (EphyBookmarksPopover *popover,
 
   /* If the bookmark no longer has 0 tags, we remove it from the tags list box */
   if (g_sequence_get_length (ephy_bookmark_get_tags (bookmark)) == 1) {
+    GtkWidget *row;
     GList *children;
     GList *l;
 
@@ -83,6 +84,12 @@ ephy_bookmarks_popover_bookmark_tag_added_cb (EphyBookmarksPopover *popover,
       if (g_strcmp0 (ephy_bookmark_get_url (bookmark), url) == 0)
         gtk_container_remove (GTK_CONTAINER (popover->tags_list_box), GTK_WIDGET (l->data));
     }
+
+    /* If we are on the tag detail list box, then the user has toggled the state
+     * of the tag widget multiple times. The first time the bookmark was removed
+     * from the list box. Now we have to add it back. */
+    row = create_bookmark_row (bookmark, popover);
+    gtk_container_add (GTK_CONTAINER (popover->tag_detail_list_box), row);
   }
 }
 


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