[Xfce4-commits] <midori:master> Do removal from bookmarkbar via the database

Christian Dywan noreply at xfce.org
Sat Jul 3 22:36:01 CEST 2010


Updating branch refs/heads/master
         to dbcc8e20540e4d3013427a553e50af43d6ea01d9 (commit)
       from 1e8e6f4652c1bef1a96f40a98f8bf95f3f4cd0f8 (commit)

commit dbcc8e20540e4d3013427a553e50af43d6ea01d9
Author: Alexander Butenko <a.butenka at gmail.com>
Date:   Fri Jul 2 10:39:53 2010 -0400

    Do removal from bookmarkbar via the database

 midori/midori-browser.c |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 41a4eec..4566d74 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



More information about the Xfce4-commits mailing list