mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 22:46:15 +01:00
GSettingsBackend: fix NULL vs "" context issues
This commit is contained in:
parent
3e36ee3426
commit
defd75fbc5
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user