diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-03-28 13:45:39 +0100 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-03-28 13:45:39 +0100 |
| commit | d9ff1192a7b5eb7defca68e90e06c68e9b986c94 (patch) | |
| tree | 904f1ff183e50aa56f4521cac87712aa163d3cca /src/setup.c | |
| parent | 7d00adae2749556d077af1fa3f0de13a2ea8e4a2 (diff) | |
| download | cataract-d9ff1192a7b5eb7defca68e90e06c68e9b986c94.tar.xz | |
Support for custom index file name
Affects every generated HTML file (i.e. all of them would have .php extensions)
Diffstat (limited to 'src/setup.c')
| -rw-r--r-- | src/setup.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/setup.c b/src/setup.c index f328196..145a5f2 100644 --- a/src/setup.c +++ b/src/setup.c @@ -100,6 +100,10 @@ parse_setup_xml (const char *filename, TGallerySetup *setup) s = xml_file_get_node_attribute (xml, "/gallery_setup/templates/support_files_use_common_root", "value"); setup->support_files_use_common_root = s ? strcasecmp (s, "yes") == 0 : FALSE; /* default to FALSE */ if (s) g_free (s); + setup->index_file_name = xml_file_get_node_value (xml, "/gallery_setup/templates/index_file/text()"); + if (setup->index_file_name == NULL || strlen (setup->index_file_name) == 0) + setup->index_file_name = strdup (DEFAULT_INDEX_FILENAME); + 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); @@ -257,6 +261,8 @@ free_setup_data (TGallerySetup *setup) free (setup->template_photo); if (setup->template_files) g_strfreev (setup->template_files); + if (setup->index_file_name) + free (setup->index_file_name); if (setup->footer) free (setup->footer); if (setup->meta_author) |
