From 90f8a7a36bd772cfed0d0cb13e3b6832ed7788b9 Mon Sep 17 00:00:00 2001 From: Vojtech Moravec Date: Sun, 19 Apr 2020 14:43:16 +0200 Subject: [PATCH] Browser: Make removal of bookmark persistent (#1865) Json model wasn't stored after bookmark removal. Store the model if remove() was successful. --- Applications/Browser/BookmarksBarWidget.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Applications/Browser/BookmarksBarWidget.cpp b/Applications/Browser/BookmarksBarWidget.cpp index eb9b6ad1db..c3b520bad1 100644 --- a/Applications/Browser/BookmarksBarWidget.cpp +++ b/Applications/Browser/BookmarksBarWidget.cpp @@ -184,8 +184,12 @@ bool BookmarksBarWidget::remove_bookmark(const String& url) auto item_url = model()->data(model()->index(item_index, 1)).to_string(); if (item_url == url) { auto& json_model = *static_cast(model()); - json_model.remove(item_index); - return true; + + const auto item_removed = json_model.remove(item_index); + if (item_removed) + json_model.store(); + + return item_removed; } }