app: accept a NULL default color in plug-ins.
Our pluginrc code is already able to output NULL for a default NULL color, but reading was failing with the following error: > GIMP-Error: Error while parsing '/home/jehan/.config/GIMP/2.99/pluginrc' in line 289: unexpected identifier 'NULL', expected number (integer) - fatal parse error Let's support reading such a value now, especially as for Python plug-ins, we are not even able to add a default value to GeglColor arguments (cf. previous commit).
This commit is contained in:
parent
634fe62f74
commit
cbb333c220
1 changed files with 15 additions and 5 deletions
|
|
@ -923,11 +923,21 @@ plug_in_proc_arg_deserialize (GScanner *scanner,
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (! gimp_scanner_parse_int (scanner, &bpp) ||
|
||||
bpp > 40 ||
|
||||
! gimp_scanner_parse_data (scanner, bpp, &data) ||
|
||||
! gimp_scanner_parse_string (scanner, &encoding) ||
|
||||
! gimp_scanner_parse_int (scanner, &profile_size))
|
||||
if (g_scanner_peek_next_token (scanner) == G_TOKEN_IDENTIFIER)
|
||||
{
|
||||
if (g_strcmp0 (scanner->next_value.v_identifier, "NULL") != 0)
|
||||
{
|
||||
token = G_TOKEN_INT;
|
||||
goto error;
|
||||
}
|
||||
g_scanner_get_next_token (scanner);
|
||||
/* NULL default color. Skip. */
|
||||
}
|
||||
else if (! gimp_scanner_parse_int (scanner, &bpp) ||
|
||||
bpp > 40 ||
|
||||
! gimp_scanner_parse_data (scanner, bpp, &data) ||
|
||||
! gimp_scanner_parse_string (scanner, &encoding) ||
|
||||
! gimp_scanner_parse_int (scanner, &profile_size))
|
||||
{
|
||||
g_free (data);
|
||||
g_free (encoding);
|
||||
|
|
|
|||
Loading…
Reference in a new issue