app: initialize GimpToolPreset's tool options from the user context

so that if deserializing wants to set an unknown brush, pattern etc.,
the previously set default value will be used instead.
This commit is contained in:
Michael Natterer 2011-04-03 00:47:41 +02:00
parent 64b9ac3f6c
commit b458b1b5c0

View file

@ -175,6 +175,14 @@ gimp_tool_preset_constructed (GObject *object)
G_OBJECT_CLASS (parent_class)->constructed (object);
g_assert (GIMP_IS_GIMP (preset->gimp));
/* initialize the tool options with sane default values, so that if
* deserializing wants to set non-existant brushe, pattern etc.,
* the previously set default object will be used instead.
*/
gimp_context_copy_properties (gimp_get_user_context (preset->gimp),
GIMP_CONTEXT (preset->tool_options),
GIMP_CONTEXT_ALL_PROPS_MASK);
}
static void