plug-ins: do not warn for invalid font names at startup.

While all other resources are supposed to be already loaded, this is not
the case of fonts which are loaded in a thread, and whose loading may
end after plug-ins are initialized. So ignore unknown font name as an
exception (because we can't know if it is really unknown or just not
loaded yet).

This fixes such WARNINGs:

> (script-fu:33006): scriptfu-WARNING **: 14:35:28.259: script_fu_add_resource_arg declared resource name is invalid Serif
This commit is contained in:
Jehan 2025-05-15 02:16:10 +02:00
parent 02fd84394c
commit 51d69fa44b

View file

@ -304,7 +304,14 @@ script_fu_add_resource_arg (
if (default_resource == NULL) if (default_resource == NULL)
{ {
g_warning ("%s declared resource name is invalid %s", G_STRFUNC, declared_name_of_default); /* Fonts are loaded asynchronously so they may not be loaded
* yet when plug-in procedures' arguments are declared. That's
* OK though because resource argument defaults are not stored
* anyway. And when the procedure will be actually called
* later on, the fonts will likely have been loaded by then.
*/
if (arg->default_value.sfa_resource.resource_type != GIMP_TYPE_FONT)
g_warning ("%s declared resource name is invalid %s", G_STRFUNC, declared_name_of_default);
script_fu_add_resource_arg_default_from_context (procedure, name, nick, blurb, func); script_fu_add_resource_arg_default_from_context (procedure, name, nick, blurb, func);
} }
else else