mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +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_lookup
|
||||||
g_settings_schema_source_ref
|
g_settings_schema_source_ref
|
||||||
g_settings_schema_source_unref
|
g_settings_schema_source_unref
|
||||||
|
g_settings_schema_source_new_from_directory
|
||||||
g_settings_schema_get_type
|
g_settings_schema_get_type
|
||||||
g_settings_schema_ref
|
g_settings_schema_ref
|
||||||
g_settings_schema_unref
|
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
|
static void
|
||||||
initialise_schema_sources (void)
|
initialise_schema_sources (void)
|
||||||
{
|
{
|
||||||
|
@ -30,20 +30,25 @@ typedef struct _GSettingsSchema GSettingsSchema;
|
|||||||
GType g_settings_schema_source_get_type (void) G_GNUC_CONST;
|
GType g_settings_schema_source_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
GSettingsSchemaSource * g_settings_schema_source_get_default (void);
|
GSettingsSchemaSource * g_settings_schema_source_get_default (void);
|
||||||
GSettingsSchemaSource * g_settings_schema_source_ref (GSettingsSchemaSource *source);
|
GSettingsSchemaSource * g_settings_schema_source_ref (GSettingsSchemaSource *source);
|
||||||
void g_settings_schema_source_unref (GSettingsSchemaSource *source);
|
void g_settings_schema_source_unref (GSettingsSchemaSource *source);
|
||||||
|
|
||||||
GSettingsSchema * g_settings_schema_source_lookup (GSettingsSchemaSource *source,
|
GSettingsSchemaSource * g_settings_schema_source_new_from_directory (GSettingsSchemaSource *parent,
|
||||||
const gchar *schema_id,
|
const gchar *directory,
|
||||||
gboolean recursive);
|
gboolean trusted,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
|
GSettingsSchema * g_settings_schema_source_lookup (GSettingsSchemaSource *source,
|
||||||
|
const gchar *schema_id,
|
||||||
|
gboolean recursive);
|
||||||
|
|
||||||
#define G_TYPE_SETTINGS_SCHEMA (g_settings_schema_get_type ())
|
#define G_TYPE_SETTINGS_SCHEMA (g_settings_schema_get_type ())
|
||||||
GType g_settings_schema_get_type (void) G_GNUC_CONST;
|
GType g_settings_schema_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
GSettingsSchema * g_settings_schema_ref (GSettingsSchema *schema);
|
GSettingsSchema * g_settings_schema_ref (GSettingsSchema *schema);
|
||||||
void g_settings_schema_unref (GSettingsSchema *schema);
|
void g_settings_schema_unref (GSettingsSchema *schema);
|
||||||
|
|
||||||
const gchar * g_settings_schema_get_id (GSettingsSchema *schema);
|
const gchar * g_settings_schema_get_id (GSettingsSchema *schema);
|
||||||
const gchar * g_settings_schema_get_path (GSettingsSchema *schema);
|
const gchar * g_settings_schema_get_path (GSettingsSchema *schema);
|
||||||
|
|
||||||
#endif /* __G_SETTINGS_SCHEMA_H__ */
|
#endif /* __G_SETTINGS_SCHEMA_H__ */
|
||||||
|
Loading…
Reference in New Issue
Block a user