GSettingsSchemaSource* g_settings_schema_source_new_from_directory ( const gchar* directory, GSettingsSchemaSource* parent, gboolean trusted, GError** error )
Attempts to create a new schema source corresponding to the contents of the given directory.
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
produced by the [glib-compile-schemas][glib-compile-schemas] tool.
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
TRUE for files installed by the
system and to
FALSE for files in the home directory.
In either case, an empty file or some types of corruption in the file will
G_FILE_ERROR_INVAL being returned.
parent is non-
NULL then there are two effects.
g_settings_schema_source_lookup() is called with the
recursive flag set to
TRUE and the schema can not be found in the
source, the lookup will recurse to the parent.
Second, any references to other schemas specified within this
extends) references may be resolved
For this second reason, except in very unusual situations, the
parent should probably be given as the default schema source, as
returned by g_settings_schema_source_get_default().
Available since: 2.32
The filename of a directory.
The data is owned by the caller of the function. The value is a file system path, using the OS encoding.
The argument can be
The data is owned by the caller of the function.
TRUE, if the directory is trusted.
The return location for a recoverable error.
The argument can be
If the return location is not
NULL, then you must initialize it to a
The argument will be left initialized to
NULLby the function if there are no errors.
In case of error, the argument will be set to a newly allocated
GError; the caller will take ownership of the data, and be responsible for freeing it.
No description available.
|The caller of the function takes ownership of the data, and is responsible for freeing it.|