newFromDirectory

fun newFromDirectory(directory: String, parent: SettingsSchemaSource? = null, trusted: Boolean): <Error class: unknown class><SettingsSchemaSource>

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 gschemas.compiled as produced by the 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.

In either case, an empty file or some types of corruption in the file will result in %G_FILE_ERROR_INVAL being returned.

If @parent is non-null then there are two effects.

First, if g_settings_schema_source_lookup() is called with the

Since

2.32

Parameters

directory

the filename of a directory

parent

a #GSettingsSchemaSource, or null

trusted

true, if the directory is trusted