From 2e8d6558d0d469773466777ad5407d395359ff00 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C5=82=20Forysiuk?= Date: Sat, 22 Jan 2011 21:17:08 +0100 Subject: [PATCH] Use KATZE_ARRAY_FOREACH_ITEM_L for export --- midori/midori-array.c | 8 ++++++-- panels/midori-bookmarks.c | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/midori/midori-array.c b/midori/midori-array.c index 9c2d4c24..58a2aad6 100644 --- a/midori/midori-array.c +++ b/midori/midori-array.c @@ -580,15 +580,17 @@ string_append_item (GString* string, { KatzeItem* _item; KatzeArray* array = KATZE_ARRAY (item); + GList* list; g_string_append (string, "\n"); /* FIXME: " folded=\"no\" */ string_append_xml_element (string, "title", katze_item_get_name (item)); string_append_xml_element (string, "desc", katze_item_get_text (item)); - KATZE_ARRAY_FOREACH_ITEM (_item, array) + KATZE_ARRAY_FOREACH_ITEM_L (_item, array, list) string_append_item (string, _item); g_string_append (string, metadata); g_string_append (string, "\n"); + g_list_free (list); } else if (katze_item_get_uri (item)) { @@ -668,6 +670,7 @@ katze_array_to_xbel (KatzeArray* array, { gchar* metadata = katze_item_metadata_to_xbel (KATZE_ITEM (array)); KatzeItem* item; + GList* list; GString* markup = g_string_new ( "\n" @@ -680,11 +683,12 @@ katze_array_to_xbel (KatzeArray* array, string_append_xml_element (markup, "title", katze_item_get_name (KATZE_ITEM (array))); string_append_xml_element (markup, "desc", katze_item_get_text (KATZE_ITEM (array))); g_string_append (markup, metadata); - KATZE_ARRAY_FOREACH_ITEM (item, array) + KATZE_ARRAY_FOREACH_ITEM_L (item, array, list) string_append_item (markup, item); g_string_append (markup, "\n"); g_free (metadata); + g_list_free (list); return g_string_free (markup, FALSE); } diff --git a/panels/midori-bookmarks.c b/panels/midori-bookmarks.c index acdee81d..b66c542a 100644 --- a/panels/midori-bookmarks.c +++ b/panels/midori-bookmarks.c @@ -131,12 +131,13 @@ midori_bookmarks_export_array_db (sqlite3* db, KatzeArray* root_array; KatzeArray* subarray; KatzeItem* item; + GList* list; sqlcmd = g_strdup_printf ("SELECT * FROM bookmarks where folder='%s'", folder); root_array = katze_array_from_sqlite (db, sqlcmd); g_free (sqlcmd); - KATZE_ARRAY_FOREACH_ITEM (item, root_array) + KATZE_ARRAY_FOREACH_ITEM_L (item, root_array, list) { if (KATZE_ITEM_IS_FOLDER (item)) { @@ -148,6 +149,7 @@ midori_bookmarks_export_array_db (sqlite3* db, else katze_array_add_item (array, item); } + g_list_free (list); } void -- 2.39.5