app: make sure all devices loaded from devicerc have tool options

We rely on GimpDeviceInfo's tool-options being non-NULL, so make sure
this is the case and fix NULL options with the current tool's options
after loading devicerc.
This commit is contained in:
Michael Natterer 2018-05-16 20:05:11 +02:00
parent 399ac63548
commit 320d23f964
1 changed files with 15 additions and 0 deletions

View File

@ -127,6 +127,21 @@ gimp_devices_restore (Gimp *gimp)
g_object_unref (file);
for (list = GIMP_LIST (manager)->queue->head;
list;
list = g_list_next (list))
{
GimpDeviceInfo *device_info = list->data;
if (! GIMP_TOOL_PRESET (device_info)->tool_options)
{
gimp_device_info_save_tool (device_info);
g_printerr ("%s: set default tool on loaded GimpDeviceInfo without tool options: %s\n",
G_STRFUNC, gimp_object_get_name (device_info));
}
}
if (! GIMP_GUI_CONFIG (gimp->config)->devices_share_tool)
{
GimpDeviceInfo *current_device;