Commit 2bd86268 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵
Browse files

Merge branch 'wip/baedert/keyfile' into 'master'

keyfile: Delay calling g_get_language_names() until it's needed

See merge request !1829
parents efcbf1f1 037f1ce6
Pipeline #242441 passed with stages
in 16 minutes and 34 seconds
......@@ -510,6 +510,7 @@ struct _GKeyFile
GKeyFileFlags flags;
gboolean checked_locales;
gchar **locales;
gint ref_count; /* (atomic) */
......@@ -635,7 +636,6 @@ g_key_file_init (GKeyFile *key_file)
key_file->parse_buffer = g_string_sized_new (128);
key_file->list_separator = ';';
key_file->flags = 0;
key_file->locales = g_strdupv ((gchar **)g_get_language_names ());
}
static void
......@@ -1232,6 +1232,12 @@ g_key_file_locale_is_interesting (GKeyFile *key_file,
if (key_file->flags & G_KEY_FILE_KEEP_TRANSLATIONS)
return TRUE;
if (!key_file->checked_locales && !key_file->locales)
{
key_file->locales = g_strdupv ((gchar **)g_get_language_names ());
key_file->checked_locales = TRUE;
}
for (i = 0; key_file->locales[i] != NULL; i++)
{
if (g_ascii_strcasecmp (key_file->locales[i], locale) == 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment