summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dfi-builder.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/src/dfi-builder.c b/src/dfi-builder.c
index f3f2591..1821e9e 100644
--- a/src/dfi-builder.c
+++ b/src/dfi-builder.c
@@ -436,38 +436,32 @@ dfi_builder_serialise (DfiBuilder *builder)
}
static void
-dfi_builder_add_strings_for_keyfile (DfiBuilder *builder,
+dfi_builder_add_strings_for_keyfile (DfiBuilder *builder,
DfiKeyfile *keyfile)
{
- guint n_groups;
- guint i;
+ gint n_groups, n_items;
+ gint i;
n_groups = dfi_keyfile_get_n_groups (keyfile);
+ n_items = dfi_keyfile_get_n_items (keyfile);
for (i = 0; i < n_groups; i++)
{
const gchar *group_name;
- guint start, end;
- guint j;
group_name = dfi_keyfile_get_group_name (keyfile, i);
- dfi_keyfile_get_group_range (keyfile, i, &start, &end);
-
dfi_string_list_ensure (builder->group_names, group_name);
+ }
- for (j = start; j < end; j++)
- {
- const gchar *key, *locale, *value;
-
- dfi_keyfile_get_item (keyfile, j, &key, &locale, &value);
-
- dfi_string_list_ensure (builder->key_names, key);
+ for (i = 0; i < n_items; i++)
+ {
+ const gchar *key, *locale, *value;
- if (locale)
- dfi_string_list_ensure (builder->locale_names, locale);
+ dfi_keyfile_get_item (keyfile, i, &key, &locale, &value);
- dfi_string_tables_add_string (builder->locale_string_tables, locale, value);
- }
+ dfi_string_list_ensure (builder->key_names, key);
+ dfi_string_list_ensure (builder->locale_names, locale); /* may be "" */
+ dfi_string_tables_add_string (builder->locale_string_tables, locale, value);
}
}