[glib] GSettingsBackend: fix NULL vs "" context issues
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] GSettingsBackend: fix NULL vs "" context issues
- Date: Thu, 15 Apr 2010 22:31:11 +0000 (UTC)
commit defd75fbc53511e27d178373ba6caa226c1ab3cf
Author: Ryan Lortie <desrt desrt ca>
Date: Thu Apr 15 18:30:06 2010 -0400
GSettingsBackend: fix NULL vs "" context issues
gio/gsettingsbackend.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gio/gsettingsbackend.c b/gio/gsettingsbackend.c
index 9828929..3b3de90 100644
--- a/gio/gsettingsbackend.c
+++ b/gio/gsettingsbackend.c
@@ -738,7 +738,7 @@ g_settings_backend_class_init (GSettingsBackendClass *class)
g_object_class_install_property (gobject_class, PROP_CONTEXT,
g_param_spec_string ("context", P_("Context"),
P_("An identifier to decide which storage to use"),
- NULL, G_PARAM_READWRITE |
+ "", G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
}
@@ -791,7 +791,7 @@ get_default_backend (const gchar *context)
extension = extensions->data;
}
- if (context)
+ if (context[0] != '\0') /* (context != "") */
{
GSettingsBackendClass *backend_class;
GTypeClass *class;
@@ -876,6 +876,8 @@ g_settings_backend_supports_context (const gchar *context)
{
GSettingsBackend *backend;
+ g_return_val_if_fail (context != NULL, NULL);
+
backend = get_default_backend (context);
if (backend)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]