diff options
Diffstat (limited to 'src/items.c')
| -rw-r--r-- | src/items.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/items.c b/src/items.c index 98f97d2..74cfb49 100644 --- a/src/items.c +++ b/src/items.c @@ -330,12 +330,45 @@ get_album_titles (const gchar *filename, gchar **title, gchar **description, gch } /* + * get_child_gallery_type: retrieve gallery type from the source XML file + */ +TGalleryType +get_child_gallery_type (const gchar *filename) +{ + TXMLFile *xml; + gchar *gallery_type; + TGalleryType result; + + /* fallback return value */ + result = GALLERY_TYPE_INDEX; + + xml = xml_parser_load (filename); + if (xml == NULL) + return result; + + gallery_type = xml_file_get_node_attribute (xml, "/gallery", "type"); + if (strcmp (gallery_type, "index") == 0) + result = GALLERY_TYPE_INDEX; + else + if (strcmp (gallery_type, "album") == 0) + result = GALLERY_TYPE_ALBUM; + else { + log_error ("Invalid gallery type (%s)\n", gallery_type); + } + g_free (gallery_type); + + xml_parser_free (xml); + return result; +} + +/* * free_path_info: free allocated pathinfo data */ void free_path_info (TPathInfo *path_info) { if (path_info) { + g_free (path_info->templates_root); g_free (path_info->source_root); g_free (path_info->dest_root); g_free (path_info->src_dir); |
