mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 15:36:14 +01:00
parent
726e4dd6e7
commit
6218d8047a
@ -1441,6 +1441,10 @@ g_keyfile_settings_backend_new
|
||||
#endif
|
||||
|
||||
#if IN_HEADER(__G_SETTINGS_H__)
|
||||
#if IN_FILE(__G_SETTINGS_SCHEMA_C__)
|
||||
g_settings_schema_exists
|
||||
#endif
|
||||
|
||||
#if IN_FILE(__G_SETTINGS_C__)
|
||||
g_settings_apply
|
||||
g_settings_bind
|
||||
|
@ -70,6 +70,7 @@ struct _GSettings
|
||||
|
||||
GType g_settings_get_type (void);
|
||||
|
||||
gboolean g_settings_schema_exists (const gchar *schema_name);
|
||||
GSettings * g_settings_new (const gchar *schema);
|
||||
GSettings * g_settings_new_with_path (const gchar *schema,
|
||||
const gchar *path);
|
||||
|
@ -237,3 +237,28 @@ g_settings_schema_list (GSettingsSchema *schema,
|
||||
*n_items = schema->priv->n_items;
|
||||
return schema->priv->items;
|
||||
}
|
||||
|
||||
/**
|
||||
* g_settings_schema_exists:
|
||||
* @schema_name: the schema name to query for
|
||||
* Returns: %TRUE if @schema_name exists
|
||||
*
|
||||
* Checks if the named schema is installed.
|
||||
**/
|
||||
gboolean
|
||||
g_settings_schema_exists (const gchar *schema_name)
|
||||
{
|
||||
GSList *source;
|
||||
|
||||
initialise_schema_sources ();
|
||||
|
||||
for (source = schema_sources; source; source = source->next)
|
||||
{
|
||||
GvdbTable *file = source->data;
|
||||
|
||||
if (gvdb_table_get_table (file, schema_name))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user