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



commit 320d23f96406d81894a8feb733c0104c0c275cc1
Author: Michael Natterer <mitch gimp org>
Date:   Wed May 16 20:05:11 2018 +0200

    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.

 app/widgets/gimpdevices.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/app/widgets/gimpdevices.c b/app/widgets/gimpdevices.c
index 2a1edc9..810fe59 100644
--- a/app/widgets/gimpdevices.c
+++ b/app/widgets/gimpdevices.c
@@ -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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]