diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2011-03-03 12:31:48 +0100 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2011-03-03 12:31:48 +0100 |
| commit | d769c3b82b245217703d243b3e83e7d8cb51af1f (patch) | |
| tree | 5901a0da4b32a583eed61deb309e9417150afba5 /src/items.c | |
| parent | 45b9708729828f944c07f8b99e7001490261cc53 (diff) | |
| download | cataract-d769c3b82b245217703d243b3e83e7d8cb51af1f.tar.xz | |
Fix atom feed paths
And convert it to use global path info.
Diffstat (limited to 'src/items.c')
| -rw-r--r-- | src/items.c | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/src/items.c b/src/items.c index 5fc1963..98f97d2 100644 --- a/src/items.c +++ b/src/items.c @@ -30,31 +30,6 @@ #include "atom-writer.h" -static gchar * -get_album_path (TAlbum *items) -{ - TIndexItem *parent_item; - TAlbum *parent; - int old_parent_item_index; - gchar *path; - gchar *s; - - path = NULL; - parent = items->parent_index; - old_parent_item_index = items->parent_item_index; - while (parent) { - parent_item = g_ptr_array_index (parent->items, old_parent_item_index); - if (! parent_item) - break; - s = g_strdup_printf ("/%s%s", parent_item->path, path ? path : ""); - g_free (path); - path = s; - old_parent_item_index = parent->parent_item_index; - parent = parent->parent_index; - } - - return path ? path : g_strdup ("/"); -} static void free_album_item (TIndexItem *item) @@ -73,7 +48,7 @@ free_album_item (TIndexItem *item) * parse_album_xml: XML parser for gallery index.xml files */ TAlbum * -parse_album_xml (const gchar *filename) +parse_album_xml (const gchar *filename, TPathInfo *path_info) { TXMLFile *xml; gchar *gallery_type; @@ -160,9 +135,7 @@ parse_album_xml (const gchar *filename) atom_feed_item_set_summary (feed_item, s2); g_free (s2); - s = get_album_path (index); - atom_feed_item_set_path (feed_item, s); - g_free (s); + atom_feed_item_set_path (feed_item, path_info->album_path); } } |
