drop the now-trivial g_settings_schema_new

Combine it into g_settings_constructed()
This commit is contained in:
Ryan Lortie 2011-11-15 08:03:38 +00:00
parent d5fb032f72
commit 3bcf1137f4
3 changed files with 11 additions and 22 deletions

View File

@ -492,9 +492,19 @@ static void
g_settings_constructed (GObject *object)
{
GSettings *settings = G_SETTINGS (object);
GSettingsSchemaSource *default_source;
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);
if (settings->priv->path && schema_path && strcmp (settings->priv->path, schema_path) != 0)

View File

@ -41,8 +41,6 @@ typedef struct
GVariant *default_value;
} GSettingsSchemaKey;
G_GNUC_INTERNAL
GSettingsSchema * g_settings_schema_new (const gchar *name);
G_GNUC_INTERNAL
const gchar * g_settings_schema_get_gettext_domain (GSettingsSchema *schema);
G_GNUC_INTERNAL

View File

@ -350,25 +350,6 @@ g_settings_schema_get_string (GSettingsSchema *schema,
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 *
g_settings_schema_get_value (GSettingsSchema *schema,
const gchar *key)