summaryrefslogtreecommitdiff
path: root/src/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/setup.c')
-rw-r--r--src/setup.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/setup.c b/src/setup.c
index 83c5504..3a2a66d 100644
--- a/src/setup.c
+++ b/src/setup.c
@@ -143,11 +143,12 @@ parse_design_setup_xml (const gchar *filename)
TXMLFile *xml;
gchar *s;
gchar *s2;
+ gchar *s3;
TGalleryDesign *design;
TImageSize *image_size;
TGalleryDesignTheme *theme;
- int count;
- int i;
+ int count, c;
+ int i, j;
xml = xml_parser_load (filename);
if (xml == NULL)
@@ -240,6 +241,19 @@ parse_design_setup_xml (const gchar *filename)
g_free (s2);
}
g_free (s);
+
+ theme->defines = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
+ s = g_strdup_printf ("/design_setup/theme[%d]/define", i + 1);
+ c = xml_file_node_get_children_count (xml, s);
+ g_free (s);
+ for (j = 0; j < c; j++) {
+ s = g_strdup_printf ("/design_setup/theme[%d]/define[%d]", i + 1, j + 1);
+ s2 = xml_file_get_node_attribute (xml, s, "name");
+ s3 = xml_file_get_node_attribute (xml, s, "value");
+ if (s2)
+ g_hash_table_replace (theme->defines, s2, s3 ? s3 : g_strdup (""));
+ g_free (s);
+ }
}
xml_parser_free (xml);
@@ -397,6 +411,7 @@ free_design_theme_data (TGalleryDesignTheme *theme)
g_free (theme->picture_filename);
g_free (theme->picture_image_size);
g_strfreev (theme->supplemental_files);
+ g_hash_table_destroy (theme->defines);
g_free (theme);
}
}