g_settings_get: only check for non-copying format string
authorLars Uebernickel <lars@uebernic.de>
Sun, 8 Dec 2013 16:30:33 +0000 (17:30 +0100)
committerLars Uebernickel <lars@uebernic.de>
Mon, 9 Dec 2013 14:51:56 +0000 (15:51 +0100)
396d40af introduced a redundant call to g_variant_check_format_string().
Checking whether the format string copies all values is enough.

https://bugzilla.gnome.org/show_bug.cgi?id=719979

gio/gsettings.c

index 62a1708..4a13443 100644 (file)
@@ -1528,9 +1528,9 @@ g_settings_get (GSettings   *settings,
 
   value = g_settings_get_value (settings, key);
 
-  if (!g_variant_check_format_string (value, format, TRUE))
+  if (strchr (format, '&'))
     {
-      g_critical ("%s: invalid format string for key '%s' from schema '%s'. "
+      g_critical ("%s: the format string may not contain '&' (key '%s' from schema '%s'). "
                   "This call will probably stop working with a future version of glib.",
                   G_STRFUNC, key, g_settings_schema_get_id (settings->priv->schema));
     }