Gio.SettingsSchemaSource.new_from_directory
function new_from_directory(directory: String, parent: Gio.SettingsSchemaSource, trusted: Boolean): Gio.SettingsSchemaSource { // Gjs wrapper for g_settings_schema_source_new_from_directory() }
Attempts to create a new schema source corresponding to the contents of the given directory.
This function is not required for normal uses of Gio.Settings 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][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 parent is non-null then there are two effects.
First, if Gio.SettingsSchemaSource.prototype.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 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 returned by Gio.settings_schema_source_get_default.
Since 2.32
- directory
the filename of a directory
- parent
a Gio.SettingsSchemaSource, or null
- trusted
true, if the directory is trusted
- Returns