diff options
Diffstat (limited to 'src/setup.c')
| -rw-r--r-- | src/setup.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/setup.c b/src/setup.c index 31bd5ca..68c32b5 100644 --- a/src/setup.c +++ b/src/setup.c @@ -92,8 +92,12 @@ parse_setup_xml (const char *filename, TGallerySetup *setup) setup->template_index = xml_file_get_node_value (xml, "/gallery_setup/templates/index/text()"); setup->template_album = xml_file_get_node_value (xml, "/gallery_setup/templates/album/text()"); setup->template_photo = xml_file_get_node_value (xml, "/gallery_setup/templates/photo/text()"); - setup->styles = xml_file_get_node_value (xml, "/gallery_setup/templates/styles/text()"); - setup->scripts = xml_file_get_node_value (xml, "/gallery_setup/templates/scripts/text()"); + s = xml_file_get_node_value (xml, "/gallery_setup/templates/template_files/text()"); + if (s) { + setup->template_files = g_strsplit (s, "\n", -1); + free (s); + } + setup->thumbnail_landscape_width = xml_file_get_node_attribute_long (xml, "/gallery_setup/images/thumbnail", "landscape_w", 0); setup->thumbnail_landscape_height = xml_file_get_node_attribute_long (xml, "/gallery_setup/images/thumbnail", "landscape_h", 0); setup->thumbnail_portrait_width = xml_file_get_node_attribute_long (xml, "/gallery_setup/images/thumbnail", "portrait_w", 0); @@ -141,8 +145,6 @@ parse_setup_xml (const char *filename, TGallerySetup *setup) printf("setup: template_index = '%s'\n", setup->template_index); printf("setup: template_album = '%s'\n", setup->template_album); printf("setup: template_photo = '%s'\n", setup->template_photo); - printf("setup: styles = '%s'\n", setup->styles); - printf("setup: scripts = '%s'\n", setup->scripts); printf("setup: thumbnail_quality = %d\n", setup->thumbnail_quality); printf("setup: thumbnail_landscape_width = %ld\n", setup->thumbnail_landscape_width); printf("setup: thumbnail_landscape_height = %ld\n", setup->thumbnail_landscape_height); @@ -184,8 +186,7 @@ int test_tmpl_files (const char *dir, TGallerySetup *setup) { return test_tmpl_access (dir, setup->template_album) | test_tmpl_access (dir, setup->template_photo) | - test_tmpl_access (dir, setup->template_index) | test_tmpl_access (dir, setup->styles) | - test_tmpl_access (dir, setup->scripts); + test_tmpl_access (dir, setup->template_index); } /* @@ -245,10 +246,8 @@ free_setup_data (TGallerySetup *setup) free (setup->template_album); if (setup->template_photo) free (setup->template_photo); - if (setup->styles) - free (setup->styles); - if (setup->scripts) - free (setup->scripts); + if (setup->template_files) + g_strfreev (setup->template_files); if (setup->footer) free (setup->footer); if (setup->meta_author) |
