[Xfce4-commits] <midori:master> Fallback to the old parent when inserting bookmarks

Christian Dywan noreply at xfce.org
Mon Jul 5 23:42:02 CEST 2010


Updating branch refs/heads/master
         to ec2d1e21c97c09251eb4b49ebd5664a3362ede39 (commit)
       from c94e12e41c1aca08b5c3c4a1cb16bbf43e6811aa (commit)

commit ec2d1e21c97c09251eb4b49ebd5664a3362ede39
Author: Christian Dywan <christian at twotoasts.de>
Date:   Mon Jul 5 23:14:49 2010 +0200

    Fallback to the old parent when inserting bookmarks

 panels/midori-bookmarks.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/panels/midori-bookmarks.c b/panels/midori-bookmarks.c
index e27df97..5450f0b 100644
--- a/panels/midori-bookmarks.c
+++ b/panels/midori-bookmarks.c
@@ -214,6 +214,7 @@ midori_bookmarks_insert_item_db (sqlite3*     db,
 {
     gchar* sqlcmd;
     char* errmsg = NULL;
+    KatzeItem* old_parent;
     gchar* parent;
     gchar* uri;
 
@@ -222,10 +223,12 @@ midori_bookmarks_insert_item_db (sqlite3*     db,
     else
         uri = g_strdup ("");
 
-    if (folder)
+    /* Use folder, otherwise fallback to parent folder */
+    old_parent = katze_item_get_parent (item);
+    if (folder && *folder)
         parent = g_strdup (folder);
-    else if (katze_item_get_name (katze_item_get_parent (item)))
-        parent = g_strdup (katze_item_get_name (katze_item_get_parent (item)));
+    else if (old_parent && katze_item_get_name (old_parent))
+        parent = g_strdup (katze_item_get_name (old_parent));
     else
         parent = g_strdup ("");
 



More information about the Xfce4-commits mailing list