[epiphany] bookmarks-popover: fix crash when deleting tag
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] bookmarks-popover: fix crash when deleting tag
- Date: Sun, 19 Feb 2017 21:00:52 +0000 (UTC)
commit f630032e1279d714d98ece3b7fdd6e41643c097a
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Sun Feb 19 14:57:22 2017 -0600
bookmarks-popover: fix crash when deleting tag
We want to do this once after processing all bookmarks, not once for
each bookmark... this was causing crashes when deleting a tag while
viewing a particular tag's list of bookmarks.
src/bookmarks/ephy-bookmarks-popover.c | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/src/bookmarks/ephy-bookmarks-popover.c b/src/bookmarks/ephy-bookmarks-popover.c
index 49301f4..d792338 100644
--- a/src/bookmarks/ephy-bookmarks-popover.c
+++ b/src/bookmarks/ephy-bookmarks-popover.c
@@ -147,20 +147,19 @@ ephy_bookmarks_popover_bookmark_tag_removed_cb (EphyBookmarksPopover *self,
const char *url;
url = g_object_get_data (G_OBJECT (l->data), "url");
- if (g_strcmp0 (ephy_bookmark_get_url (bookmark), url) == 0) {
+ if (g_strcmp0 (ephy_bookmark_get_url (bookmark), url) == 0)
gtk_container_remove (GTK_CONTAINER (self->tag_detail_list_box), GTK_WIDGET (l->data));
+ }
+
+ /* If we removed a tag's last bookmark while on the tags detail box,
+ * we switch back to the tags list stack */
+ if (g_sequence_is_empty (ephy_bookmarks_manager_get_bookmarks_with_tag (self->manager, tag))) {
+ GActionGroup *group;
+ GAction *action;
- /* If we removed a tag's last bookmark while on the tags detail box,
- * we switch back to the tags list stack */
- if (g_sequence_is_empty (ephy_bookmarks_manager_get_bookmarks_with_tag (self->manager, tag))) {
- GActionGroup *group;
- GAction *action;
-
- group = gtk_widget_get_action_group (GTK_WIDGET (self), "popover");
- action = g_action_map_lookup_action (G_ACTION_MAP (group), "tag-detail-back");
- g_action_activate (action, NULL);
- }
- }
+ group = gtk_widget_get_action_group (GTK_WIDGET (self), "popover");
+ action = g_action_map_lookup_action (G_ACTION_MAP (group), "tag-detail-back");
+ g_action_activate (action, NULL);
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]