X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gio%2Fgsettingsschema.c;h=85cad60cb4dd0c50bd9ec2b3b3fcf7682ad357e4;hb=a3d86afa81ff34ce797a3928fd619ead219a37af;hp=ba1420360cbdf4e75aaa9b8364f7470816bede78;hpb=306dfb32923ddde09fb72044aa8aa1349c969569;p=platform%2Fupstream%2Fglib.git diff --git a/gio/gsettingsschema.c b/gio/gsettingsschema.c index ba14203..85cad60 100644 --- a/gio/gsettingsschema.c +++ b/gio/gsettingsschema.c @@ -250,16 +250,14 @@ g_settings_schema_source_unref (GSettingsSchemaSource *source) * This function is not required for normal uses of #GSettings but it * may be useful to authors of plugin management systems. * - * The directory should contain a file called - * gschemas.compiled as produced by the - * glib-compile-schemas tool. + * The directory should contain a file called `gschemas.compiled` as + * produced by the [glib-compile-schemas][glib-compile-schemas] tool. * - * If @trusted is %TRUE then gschemas.compiled is - * trusted not to be corrupted. This assumption has a performance - * advantage, but can result in crashes or inconsistent behaviour in the - * case of a corrupted file. Generally, you should set @trusted to - * %TRUE for files installed by the system and to %FALSE for files in - * the home directory. + * If @trusted is %TRUE then `gschemas.compiled` is trusted not to be + * corrupted. This assumption has a performance advantage, but can result + * in crashes or inconsistent behaviour in the case of a corrupted file. + * Generally, you should set @trusted to %TRUE for files installed by the + * system and to %FALSE for files in the home directory. * * If @parent is non-%NULL then there are two effects. * @@ -268,8 +266,8 @@ g_settings_schema_source_unref (GSettingsSchemaSource *source) * source, the lookup will recurse to the parent. * * Second, any references to other schemas specified within this - * source (ie: child or extends) - * references may be resolved from the @parent. + * source (ie: `child` or `extends`) references may be resolved + * from the @parent. * * For this second reason, except in very unusual situations, the * @parent should probably be given as the default schema source, as @@ -363,9 +361,8 @@ initialise_schema_sources (void) * * The returned source may actually consist of multiple schema sources * from different directories, depending on which directories were given - * in XDG_DATA_DIRS and - * GSETTINGS_SCHEMA_DIR. For this reason, all lookups - * performed against the default source should probably be done + * in `XDG_DATA_DIRS` and `GSETTINGS_SCHEMA_DIR`. For this reason, all + * lookups performed against the default source should probably be done * recursively. * * Returns: (transfer none): the default schema source @@ -397,7 +394,7 @@ g_settings_schema_source_get_default (void) * * If the schema isn't found, %NULL is returned. * - * Returns: (transfer full): a new #GSettingsSchema + * Returns: (nullable) (transfer full): a new #GSettingsSchema * * Since: 2.32 **/ @@ -676,8 +673,9 @@ parse_into_text_tables (const gchar *directory, GMarkupParseContext *context; context = g_markup_parse_context_new (&parser, G_MARKUP_TREAT_CDATA_AS_TEXT, &info, NULL); + /* Ignore errors here, this is best effort only. */ if (g_markup_parse_context_parse (context, contents, size, NULL)) - g_markup_parse_context_end_parse (context, NULL); + (void) g_markup_parse_context_end_parse (context, NULL); g_markup_parse_context_free (context); /* Clean up dangling stuff in case there was an error. */ @@ -700,6 +698,8 @@ parse_into_text_tables (const gchar *directory, g_free (filename); } + + g_dir_close (dir); } static GHashTable ** @@ -726,9 +726,10 @@ g_settings_schema_source_get_text_tables (GSettingsSchemaSource *source) * g_settings_schema_source_list_schemas: * @source: a #GSettingsSchemaSource * @recursive: if we should recurse - * @non_relocatable: (out) (transfer full): the list of non-relocatable - * schemas - * @relocatable: (out) (transfer full): the list of relocatable schemas + * @non_relocatable: (out) (transfer full) (array zero-terminated=1): the + * list of non-relocatable schemas + * @relocatable: (out) (transfer full) (array zero-terminated=1): the list + * of relocatable schemas * * Lists the schemas in a given source. * @@ -1291,7 +1292,7 @@ g_settings_schema_key_get_translated_default (GSettingsSchemaKey *key) if (value == NULL) { g_warning ("Failed to parse translated string '%s' for " - "key '%s' in schema '%s': %s", key->unparsed, key->name, + "key '%s' in schema '%s': %s", translated, key->name, g_settings_schema_get_id (key->schema), error->message); g_warning ("Using untranslated default instead."); g_error_free (error); @@ -1594,31 +1595,28 @@ g_settings_schema_key_get_default_value (GSettingsSchemaKey *key) * This function will return a #GVariant that fully describes the range * of values that are valid for @key. * - * The type of #GVariant returned is (sv). The - * string describes the type of range restriction in effect. The type - * and meaning of the value contained in the variant depends on the - * string. + * The type of #GVariant returned is `(sv)`. The string describes + * the type of range restriction in effect. The type and meaning of + * the value contained in the variant depends on the string. * - * If the string is 'type' then the variant contains - * an empty array. The element type of that empty array is the expected - * type of value and all values of that type are valid. + * If the string is `'type'` then the variant contains an empty array. + * The element type of that empty array is the expected type of value + * and all values of that type are valid. * - * If the string is 'enum' then the variant contains - * an array enumerating the possible values. Each item in the array is + * If the string is `'enum'` then the variant contains an array + * enumerating the possible values. Each item in the array is * a possible valid value and no other values are valid. * - * If the string is 'flags' then the variant contains - * an array. Each item in the array is a value that may appear zero or - * one times in an array to be used as the value for this key. For - * example, if the variant contained the array ['x', - * 'y'] then the valid values for the key would be - * [], ['x'], - * ['y'], ['x', 'y'] and - * ['y', 'x']. - * - * Finally, if the string is 'range' then the variant - * contains a pair of like-typed values -- the minimum and maximum - * permissible values for this key. + * If the string is `'flags'` then the variant contains an array. Each + * item in the array is a value that may appear zero or one times in an + * array to be used as the value for this key. For example, if the + * variant contained the array `['x', 'y']` then the valid values for + * the key would be `[]`, `['x']`, `['y']`, `['x', 'y']` and + * `['y', 'x']`. + * + * Finally, if the string is `'range'` then the variant contains a pair + * of like-typed values -- the minimum and maximum permissible values + * for this key. * * This information should not be used by normal programs. It is * considered to be a hint for introspection purposes. Normal programs