]> spindle.queued.net Git - midori/commitdiff
Export to a new, empty bookmark array
authorChristian Dywan <christian@twotoasts.de>
Sat, 22 Jan 2011 20:17:37 +0000 (21:17 +0100)
committerChristian Dywan <christian@twotoasts.de>
Sat, 22 Jan 2011 20:17:37 +0000 (21:17 +0100)
midori/midori-browser.c

index 802806a3d73e4d2b6c541b8e401973cc21f1e09e..6cccaca64a1b5d798e40609b9f8f15a5b4c8dfad 100644 (file)
@@ -4134,6 +4134,7 @@ _action_bookmarks_export_activate (GtkAction*     action,
     gchar* path = NULL;
     GError* error;
     sqlite3* db;
+    KatzeArray* bookmarks;
 
     if (!browser->bookmarks || !gtk_widget_get_visible (GTK_WIDGET (browser)))
         return;
@@ -4151,14 +4152,16 @@ _action_bookmarks_export_activate (GtkAction*     action,
 
     error = NULL;
     db = g_object_get_data (G_OBJECT (browser->history), "db");
-    midori_bookmarks_export_array_db (db, browser->bookmarks, "");
-    if (!midori_array_to_file (browser->bookmarks, path, "xbel", &error))
+    bookmarks = katze_array_new (KATZE_TYPE_ARRAY);
+    midori_bookmarks_export_array_db (db, bookmarks, "");
+    if (!midori_array_to_file (bookmarks, path, "xbel", &error))
     {
         sokoke_message_dialog (GTK_MESSAGE_ERROR,
             _("Failed to export bookmarks"), error ? error->message : "");
         if (error)
             g_error_free (error);
     }
+    g_object_unref (bookmarks);
     g_free (path);
 }