GSettingsBackend: fix NULL vs "" context issues

This commit is contained in:
Ryan Lortie 2010-04-15 18:30:06 -04:00
parent 3e36ee3426
commit defd75fbc5

View File

@ -738,7 +738,7 @@ g_settings_backend_class_init (GSettingsBackendClass *class)
g_object_class_install_property (gobject_class, PROP_CONTEXT, g_object_class_install_property (gobject_class, PROP_CONTEXT,
g_param_spec_string ("context", P_("Context"), g_param_spec_string ("context", P_("Context"),
P_("An identifier to decide which storage to use"), P_("An identifier to decide which storage to use"),
NULL, G_PARAM_READWRITE | "", G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
} }
@ -791,7 +791,7 @@ get_default_backend (const gchar *context)
extension = extensions->data; extension = extensions->data;
} }
if (context) if (context[0] != '\0') /* (context != "") */
{ {
GSettingsBackendClass *backend_class; GSettingsBackendClass *backend_class;
GTypeClass *class; GTypeClass *class;
@ -876,6 +876,8 @@ g_settings_backend_supports_context (const gchar *context)
{ {
GSettingsBackend *backend; GSettingsBackend *backend;
g_return_val_if_fail (context != NULL, NULL);
backend = get_default_backend (context); backend = get_default_backend (context);
if (backend) if (backend)