mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-16 04:28:05 +02:00
Add an --allow-any-name option
This will make it easier for people to keep their GConf key names in the transition period. Conflicts: gio/gschema-compile.c
This commit is contained in:
parent
c83a976245
commit
64cc81f769
@ -53,6 +53,8 @@ typedef struct
|
|||||||
GVariantType *type;
|
GVariantType *type;
|
||||||
} ParseState;
|
} ParseState;
|
||||||
|
|
||||||
|
static gboolean allow_any_name = FALSE;
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
is_valid_keyname (const gchar *key,
|
is_valid_keyname (const gchar *key,
|
||||||
GError **error)
|
GError **error)
|
||||||
@ -66,6 +68,9 @@ is_valid_keyname (const gchar *key,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (allow_any_name)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
if (!g_ascii_islower (key[0]))
|
if (!g_ascii_islower (key[0]))
|
||||||
{
|
{
|
||||||
g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
|
g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
|
||||||
@ -498,10 +503,10 @@ main (int argc, char **argv)
|
|||||||
GOptionEntry entries[] = {
|
GOptionEntry entries[] = {
|
||||||
{ "targetdir", 0, 0, G_OPTION_ARG_FILENAME, &targetdir, N_("where to store the gschemas.compiled file"), N_("DIRECTORY") },
|
{ "targetdir", 0, 0, G_OPTION_ARG_FILENAME, &targetdir, N_("where to store the gschemas.compiled file"), N_("DIRECTORY") },
|
||||||
{ "dry-run", 0, 0, G_OPTION_ARG_NONE, &dry_run, N_("Do not write the gschema.compiled file"), NULL },
|
{ "dry-run", 0, 0, G_OPTION_ARG_NONE, &dry_run, N_("Do not write the gschema.compiled file"), NULL },
|
||||||
|
{ "allow-any-name", 0, 0, G_OPTION_ARG_NONE, &allow_any_name, N_("Do not enforce key name restrictions") },
|
||||||
|
|
||||||
/* These options are only for use in the gschema-compile tests */
|
/* These options are only for use in the gschema-compile tests */
|
||||||
{ "one-schema-file", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_FILENAME, &one_schema_file, NULL, NULL },
|
{ "one-schema-file", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_FILENAME, &one_schema_file, NULL, NULL },
|
||||||
|
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user