mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 15:06:14 +01:00
drop the now-trivial g_settings_schema_new
Combine it into g_settings_constructed()
This commit is contained in:
parent
d5fb032f72
commit
3bcf1137f4
@ -492,9 +492,19 @@ static void
|
|||||||
g_settings_constructed (GObject *object)
|
g_settings_constructed (GObject *object)
|
||||||
{
|
{
|
||||||
GSettings *settings = G_SETTINGS (object);
|
GSettings *settings = G_SETTINGS (object);
|
||||||
|
GSettingsSchemaSource *default_source;
|
||||||
const gchar *schema_path;
|
const gchar *schema_path;
|
||||||
|
|
||||||
settings->priv->schema = g_settings_schema_new (settings->priv->schema_name);
|
default_source = g_settings_schema_source_get_default ();
|
||||||
|
|
||||||
|
if (default_source == NULL)
|
||||||
|
g_error ("No GSettings schemas are installed on the system");
|
||||||
|
|
||||||
|
settings->priv->schema = g_settings_schema_source_lookup (default_source, settings->priv->schema_name, TRUE);
|
||||||
|
|
||||||
|
if (settings->priv->schema == NULL)
|
||||||
|
g_error ("Settings schema '%s' is not installed\n", settings->priv->schema_name);
|
||||||
|
|
||||||
schema_path = g_settings_schema_get_path (settings->priv->schema);
|
schema_path = g_settings_schema_get_path (settings->priv->schema);
|
||||||
|
|
||||||
if (settings->priv->path && schema_path && strcmp (settings->priv->path, schema_path) != 0)
|
if (settings->priv->path && schema_path && strcmp (settings->priv->path, schema_path) != 0)
|
||||||
|
@ -41,8 +41,6 @@ typedef struct
|
|||||||
GVariant *default_value;
|
GVariant *default_value;
|
||||||
} GSettingsSchemaKey;
|
} GSettingsSchemaKey;
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
|
||||||
GSettingsSchema * g_settings_schema_new (const gchar *name);
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
const gchar * g_settings_schema_get_gettext_domain (GSettingsSchema *schema);
|
const gchar * g_settings_schema_get_gettext_domain (GSettingsSchema *schema);
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
|
@ -350,25 +350,6 @@ g_settings_schema_get_string (GSettingsSchema *schema,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
GSettingsSchema *
|
|
||||||
g_settings_schema_new (const gchar *name)
|
|
||||||
{
|
|
||||||
GSettingsSchemaSource *source;
|
|
||||||
GSettingsSchema *schema;
|
|
||||||
|
|
||||||
source = g_settings_schema_source_get_default ();
|
|
||||||
|
|
||||||
if (source == NULL)
|
|
||||||
g_error ("No GSettings schemas are installed on the system");
|
|
||||||
|
|
||||||
schema = g_settings_schema_source_lookup (source, name, TRUE);
|
|
||||||
|
|
||||||
if (schema == NULL)
|
|
||||||
g_error ("Settings schema '%s' is not installed\n", name);
|
|
||||||
|
|
||||||
return schema;
|
|
||||||
}
|
|
||||||
|
|
||||||
GVariantIter *
|
GVariantIter *
|
||||||
g_settings_schema_get_value (GSettingsSchema *schema,
|
g_settings_schema_get_value (GSettingsSchema *schema,
|
||||||
const gchar *key)
|
const gchar *key)
|
||||||
|
Loading…
Reference in New Issue
Block a user