mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-23 12:41:50 +01:00
Add g_settings_schema_source_new_from_directory()
It is now possible for plugin loading systems to do the right thing.
This commit is contained in:
parent
446eda8c2b
commit
fee2c87ba1
@ -1103,6 +1103,7 @@ g_settings_schema_source_get_default
|
||||
g_settings_schema_source_lookup
|
||||
g_settings_schema_source_ref
|
||||
g_settings_schema_source_unref
|
||||
g_settings_schema_source_new_from_directory
|
||||
g_settings_schema_get_type
|
||||
g_settings_schema_ref
|
||||
g_settings_schema_unref
|
||||
|
@ -93,6 +93,31 @@ g_settings_schema_source_unref (GSettingsSchemaSource *source)
|
||||
}
|
||||
}
|
||||
|
||||
GSettingsSchemaSource *
|
||||
g_settings_schema_source_new_from_directory (GSettingsSchemaSource *parent,
|
||||
const gchar *directory,
|
||||
gboolean trusted,
|
||||
GError **error)
|
||||
{
|
||||
GSettingsSchemaSource *source;
|
||||
GvdbTable *table;
|
||||
gchar *filename;
|
||||
|
||||
filename = g_build_filename (directory, "gschemas.compiled", NULL);
|
||||
table = gvdb_table_new (filename, TRUE, error);
|
||||
g_free (filename);
|
||||
|
||||
if (table == NULL)
|
||||
return NULL;
|
||||
|
||||
source = g_slice_new (GSettingsSchemaSource);
|
||||
source->parent = parent ? g_settings_schema_source_ref (parent) : NULL;
|
||||
source->table = table;
|
||||
source->ref_count = 1;
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
static void
|
||||
initialise_schema_sources (void)
|
||||
{
|
||||
|
@ -33,6 +33,11 @@ GSettingsSchemaSource * g_settings_schema_source_get_default (void);
|
||||
GSettingsSchemaSource * g_settings_schema_source_ref (GSettingsSchemaSource *source);
|
||||
void g_settings_schema_source_unref (GSettingsSchemaSource *source);
|
||||
|
||||
GSettingsSchemaSource * g_settings_schema_source_new_from_directory (GSettingsSchemaSource *parent,
|
||||
const gchar *directory,
|
||||
gboolean trusted,
|
||||
GError **error);
|
||||
|
||||
GSettingsSchema * g_settings_schema_source_lookup (GSettingsSchemaSource *source,
|
||||
const gchar *schema_id,
|
||||
gboolean recursive);
|
||||
|
Loading…
Reference in New Issue
Block a user