summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2009-04-11 16:39:33 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2009-04-11 16:39:33 +0200
commit498e7aaa9e657ef3ff0406964d62166e37e0299f (patch)
treee2f429864abe12ee870f7fca50423404d9aa5fb2 /src
parent9c2c964727e4a484acf7f97267a3cf1c8fbacd89 (diff)
downloadcataract-498e7aaa9e657ef3ff0406964d62166e37e0299f.tar.xz
Support for interspaces
Diffstat (limited to 'src')
-rw-r--r--src/generators.c6
-rw-r--r--src/items.c10
-rw-r--r--src/items.h3
3 files changed, 18 insertions, 1 deletions
diff --git a/src/generators.c b/src/generators.c
index 8dd6a58..0a21b7e 100644
--- a/src/generators.c
+++ b/src/generators.c
@@ -332,6 +332,7 @@ write_html_album (TGallerySetup *setup,
block_parser_register_key (block_parser, "IMG_LIST_LANDSCAPE", NULL);
block_parser_register_key (block_parser, "IMG_LIST_PORTRAIT", NULL);
block_parser_register_key (block_parser, "LIST_SEPARATOR", NULL);
+ block_parser_register_key (block_parser, "LIST_INTERSPACE", NULL);
block_parser_register_key (block_parser, "GO_UP", "GO_UP");
@@ -392,6 +393,11 @@ write_html_album (TGallerySetup *setup,
s1 = block_parser_get_data (block_parser, "LIST_SEPARATOR");
replace_table_add_key (local_replace_table, "LIST_SEPARATOR_TITLE", item->title);
break;
+
+ case INDEX_ITEM_TYPE_INTERSPACE:
+ s1 = block_parser_get_data (block_parser, "LIST_INTERSPACE");
+ replace_table_add_key (local_replace_table, "LIST_INTERSPACE_TITLE", item->title);
+ break;
}
if (s1) {
diff --git a/src/items.c b/src/items.c
index 2b9a1ad..27034f2 100644
--- a/src/items.c
+++ b/src/items.c
@@ -197,6 +197,16 @@ parse_album_xml (const char *filename, TAlbum *index)
g_ptr_array_add (index->items, item);
}
+ else
+ if (strcmp (node_name, "interspace") == 0) {
+ item->type = INDEX_ITEM_TYPE_INTERSPACE;
+
+ s = g_strdup_printf ("/gallery/items/*[%d]/text()", i + 1);
+ item->title = xml_file_get_node_value (xml, s);
+ g_free (s);
+
+ g_ptr_array_add (index->items, item);
+ }
else {
/* Free the item if nobody cares */
free (item);
diff --git a/src/items.h b/src/items.h
index daaefb0..b7be433 100644
--- a/src/items.h
+++ b/src/items.h
@@ -29,7 +29,8 @@ typedef enum {
typedef enum {
INDEX_ITEM_TYPE_PICTURE = 1 << 0,
- INDEX_ITEM_TYPE_SEPARATOR = 1 << 1
+ INDEX_ITEM_TYPE_SEPARATOR = 1 << 1,
+ INDEX_ITEM_TYPE_INTERSPACE = 1 << 2
} TIndexItemType;
typedef struct {