From: Alexander Butenko Date: Fri, 2 Jul 2010 14:39:53 +0000 (-0400) Subject: Do removal from bookmarkbar via the database X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbcc8e20540e4d3013427a553e50af43d6ea01d9;p=midori Do removal from bookmarkbar via the database --- diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 41a4eec8..4566d744 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -3981,33 +3981,27 @@ midori_browser_bookmark_edit_activate_cb (GtkWidget* menuitem, MidoriBrowser* browser) { KatzeItem* item; - const gchar* uri; item = (KatzeItem*)g_object_get_data (G_OBJECT (menuitem), "KatzeItem"); - uri = katze_item_get_uri (item); - if (!uri) - midori_browser_edit_bookmark_dialog_new (browser, item, FALSE, TRUE); - else + if (KATZE_ITEM_IS_BOOKMARK (item)) midori_browser_edit_bookmark_dialog_new (browser, item, FALSE, FALSE); + else + midori_browser_edit_bookmark_dialog_new (browser, item, FALSE, TRUE); } static void midori_browser_bookmark_delete_activate_cb (GtkWidget* menuitem, MidoriBrowser* browser) { + sqlite3* db; KatzeItem* item; - const gchar* uri; - KatzeItem* parent; + db = g_object_get_data (G_OBJECT (browser->bookmarks), "db"); item = (KatzeItem*)g_object_get_data (G_OBJECT (menuitem), "KatzeItem"); - uri = katze_item_get_uri (item); - - /* FIXME: Even toplevel items should technically have a parent */ - g_return_if_fail (katze_item_get_parent (item)); - parent = katze_item_get_parent (item); - katze_array_remove_item (KATZE_ARRAY (parent), item); + midori_bookmarks_remove_item_from_db (db, item); + g_object_unref (item); } static void