Export to a new, empty bookmark array
This commit is contained in:
parent
2e8d6558d0
commit
7a0d04ac52
1 changed files with 5 additions and 2 deletions
|
@ -4134,6 +4134,7 @@ _action_bookmarks_export_activate (GtkAction* action,
|
||||||
gchar* path = NULL;
|
gchar* path = NULL;
|
||||||
GError* error;
|
GError* error;
|
||||||
sqlite3* db;
|
sqlite3* db;
|
||||||
|
KatzeArray* bookmarks;
|
||||||
|
|
||||||
if (!browser->bookmarks || !gtk_widget_get_visible (GTK_WIDGET (browser)))
|
if (!browser->bookmarks || !gtk_widget_get_visible (GTK_WIDGET (browser)))
|
||||||
return;
|
return;
|
||||||
|
@ -4151,14 +4152,16 @@ _action_bookmarks_export_activate (GtkAction* action,
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
db = g_object_get_data (G_OBJECT (browser->history), "db");
|
db = g_object_get_data (G_OBJECT (browser->history), "db");
|
||||||
midori_bookmarks_export_array_db (db, browser->bookmarks, "");
|
bookmarks = katze_array_new (KATZE_TYPE_ARRAY);
|
||||||
if (!midori_array_to_file (browser->bookmarks, path, "xbel", &error))
|
midori_bookmarks_export_array_db (db, bookmarks, "");
|
||||||
|
if (!midori_array_to_file (bookmarks, path, "xbel", &error))
|
||||||
{
|
{
|
||||||
sokoke_message_dialog (GTK_MESSAGE_ERROR,
|
sokoke_message_dialog (GTK_MESSAGE_ERROR,
|
||||||
_("Failed to export bookmarks"), error ? error->message : "");
|
_("Failed to export bookmarks"), error ? error->message : "");
|
||||||
if (error)
|
if (error)
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
}
|
}
|
||||||
|
g_object_unref (bookmarks);
|
||||||
g_free (path);
|
g_free (path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue