From 687de063f9bf8f2ec26bfcdf2921f3a768cb06e7 Mon Sep 17 00:00:00 2001 From: Alexander Butenko Date: Mon, 19 Jul 2010 20:55:59 +0200 Subject: [PATCH] Clear the bookmarkbar before populating and populate after editing --- midori/midori-browser.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index e2063b2b..16f25e24 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -182,6 +182,12 @@ void midori_bookmarks_remove_item_from_db (sqlite3* db, KatzeItem* item); +static void +midori_bookmarkbar_populate (MidoriBrowser* browser); + +static void +midori_bookmarkbar_clear (GtkWidget* toolbar); + static void midori_browser_new_history_item (MidoriBrowser* browser, KatzeItem** item); @@ -947,6 +953,8 @@ midori_browser_edit_bookmark_dialog_new (MidoriBrowser* browser, g_free (selected); return_status = TRUE; } + if (gtk_widget_get_visible (browser->bookmarkbar)) + midori_bookmarkbar_populate (browser); gtk_widget_destroy (dialog); return return_status; } @@ -6331,7 +6339,9 @@ midori_bookmarkbar_populate (MidoriBrowser* browser) const gchar* sqlcmd; KatzeArray* array; KatzeItem* item; - gint i; + gint i = 0; + + midori_bookmarkbar_clear (browser->bookmarkbar); homepage = gtk_action_create_tool_item (_action_by_name (browser, "Homepage")); gtk_tool_item_set_is_important (GTK_TOOL_ITEM (homepage), TRUE); @@ -6344,7 +6354,7 @@ midori_bookmarkbar_populate (MidoriBrowser* browser) if (!db) return; - sqlcmd = "SELECT uri, title, app, folder FROM bookmarks WHERE " + sqlcmd = "SELECT uri, title, app, folder, toolbar FROM bookmarks WHERE " " toolbar = 1 ORDER BY uri ASC"; array = katze_array_from_sqlite (db, sqlcmd);