[Xfce4-commits] <midori:master> Import to a new, empty bookmark array

Christian Dywan noreply at xfce.org
Sat Jan 22 21:24:01 CET 2011


Updating branch refs/heads/master
         to f9c38fda6fcf246367db1640dac78dc0a7af76fd (commit)
       from 7a0d04ac52782a34e3dda6ebd0053c2459ab9ade (commit)

commit f9c38fda6fcf246367db1640dac78dc0a7af76fd
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sat Jan 22 21:24:10 2011 +0100

    Import to a new, empty bookmark array

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

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 6cccaca..5e70e1f 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -4004,6 +4004,7 @@ _action_bookmarks_import_activate (GtkAction*     action,
     gint icon_width = 16;
     guint i;
     KatzeItem* item;
+    KatzeArray* bookmarks;
     sqlite3* db;
     const gchar* sqlcmd;
     KatzeArray* bookmarkdirs;
@@ -4110,15 +4111,17 @@ _action_bookmarks_import_activate (GtkAction*     action,
         }
 
         error = NULL;
-        if (path && !midori_array_from_file (browser->bookmarks, path, NULL, &error))
+        bookmarks = katze_array_new (KATZE_TYPE_ARRAY);
+        if (path && !midori_array_from_file (bookmarks, path, NULL, &error))
         {
             sokoke_message_dialog (GTK_MESSAGE_ERROR,
                 _("Failed to import bookmarks"), error ? error->message : "");
             if (error)
                 g_error_free (error);
         }
-        midori_bookmarks_import_array_db (db, browser->bookmarks, selected);
+        midori_bookmarks_import_array_db (db, bookmarks, selected);
         katze_array_update (browser->bookmarks);
+        g_object_unref (bookmarks);
         g_free (selected);
         g_free (path);
     }



More information about the Xfce4-commits mailing list